Usually little setup of Apache and Nginx is needed so they can handle React routes properly without trying to treat them as real files or directories resulting in 404 Not Found in React. Here are the snippets of the React routes related settings for Apache and Nginx.
Tag: apache
Dec 23 2022
Implement Secure Headers in Apache and Nginx
HTTP security headers are very important part of website security as it protect you against different types of attacks including, XSS, SQL injection, clickjacking, etc. When you visit any website from your web browser, your browser requests it from the web server where the web site is hosted on. The web server then responds with …
Dec 23 2022
Implementing Cache control headers in Nginx and Apache
Cache-Control are HTTP cache headers that holds instructions for caching for requests and responses. It is used to defines how a resource is cached, where it’s cached and its maximum age before expiring. When you visit a website, your browser will save images and website data in a store called the cache. When you revisit …
Nov 08 2022
.htaccess: Option FollowSymLinks not allowed here
I moved from mod_php to fcgi style hosting and got the following in Apache error log when I tried to open one of my websites: [Tue Nov 08 08:34:08.357359 2022] [core:alert] [pid 19149] [client 95.158.43.63:14405] /home/domain.com/public_html/.htaccess: Option All not allowed here [Tue Nov 08 08:35:58.058962 2022] [core:alert] [pid 14190] [client 95.158.43.63:46366] /home/domain.com/public_html/.htaccess: Option FollowSymlinks not …
Nov 24 2021
Implementing Security Headers in Azure App Service
If you want to follow best security practices and implement Strict Transport Security and Secure Headers in your Azure App Service you will need to add Security Headers in web.config or .htaccess files in your web application’s root folder. Before you start remember that App Services run on a PaaS. This means that not everything …
Oct 15 2021
No input file specified error
When going on some link you can get “No input file specified” error in your browser. To resolve this error, check that in the file .htaccess there was no line:
1 |
RewriteRule ^(.*)$ /index.php/$1 [L,QSA] |
Copy
May 05 2021
Letsencrypt Unable to find a virtual host listening on port 80
I installed Goautodial where access via HTTPS was configured “out-of-the-box” with self-signed certificate. HTTP access was configured through like default website in Apache without using VirtualHost directive. I tried to get a certificate from Letsencrypt and got the following error: Unable to find a virtual host listening on port 80 which is currently needed for …
Mar 09 2021
Virtualmin: no Manage SSL certificate option
The problem is that you want to enable SSL certificate for virtual domain in Virtualmin but the Manage SSL certificate option is absent from the Server Configuration. By default Manage SSL option is absent and you need to enable it in Features. To do so go toEdit Virtual Server -> Enabled Features, and set “Apache …
Aug 19 2020
How to remove mod_pagespeed from access.log
If you have mod_pagespeed installed on your webserver you may notice the following lines in access.log file:
1 2 3 |
*ipofserver* - - [24/Jan/2019:13:40:13 +0100] "GET /wp-content/***.jpg HTTP/1.1" 200 1806 "https://***.com/*" "Serf/1.3.9 (mod_pagespeed/1.13.35.2-0)" *ipofserver* - - [24/Jan/2019:13:40:13 +0100] "GET /wp-content/***.jpg HTTP/1.1" 200 1806 "https://***.com/*" "Serf/1.3.9 (mod_pagespeed/1.13.35.2-0)" *ipofserver* - - [24/Jan/2019:13:40:13 +0100] "GET /wp-content/***.jpg HTTP/1.1" 200 1806 "https://***.com/*" "Serf/1.3.9 (mod_pagespeed/1.13.35.2-0)" |
Depending on the size of your website requests from mod_pagespeed can add flood your logfiles and their size will be significantly larger. Here is how you can exclude mod_pagespeed requests from access.log file
Aug 19 2020
How not to log certain requests in Apache
By default Apache logs all requests. Sometimes you need to exclude logging of certain requests from Apache‘s access.log. For example some automated requests coming and flood your log distorting your statistics. This short guide shows how you use Apache’s SetEnvIf directive to prevent Apache from logging such requests.
- 1
- 2