Enable CORS in Nginx
To enable CORS in nginx, add following inside web sites sevrer config. Restart nginx See CORS
List installed Modules in Nginx
To list modules compiled with nginx, you can run nginx -V This print nginx version along with configuration used to
Nginx remove html from url
If you have a static website build using plain html files, your url will look like https://yourdomain/page.html. This .html extension
Nginx show full url in access log
To show the full URL in nginx access log, add the following If you are behind reverse proxy, replace $remote_addr
Nginx HTTP 414 request-URI too large
On a Nginx server, when accessing a long url, i get error To fix the error, edit inside “http” section,
Show Real IP Nginx Behind Reverse Proxy
When your Nginx web server is running behind a reverse proxy, you will see IP of the reverse proxy server
Nginx Location Directive
Nginx Location Directive is used to route request to correct files. Match Exact match is used to match an exact
Nginx Password Protect a website
To password protect a web site, you need to install htpasswd utility. On Ubuntu/Debian, you can install it with command
Configure Nginx to listen on single IP Address
By default Nginx listens on all IP address on a server. To make nginx listen on specific IP address, edit
Nginx Config for Laravel Application in sub folder
To run Laravel Application on sub folder of a web site, use following configuration. If you run Laravel application as
Nginx Config for Laravel Application
Here is Nginx configuration for a laravel application Nginx Config for Laravel Application in sub folder
Disable TLSv1 in Nginx
To disable TLSv1 in nginx, add in your server config. if you are using letsencrypt SSL, edit file Find Replace