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 configuration file

And VirtualHost/server files for each domain located in folders

Find

Replace with

IP_ADDR_HERE = your server IP address on which you need nginx listen on. See Nginx […]

Read More…

Nginx Config for Laravel Application in sub folder

Nginx Web Server

To run Laravel Application on sub folder of a web site, use following configuration. If you run Laravel application as main site, see Nginx Config for Laravel Application

Here you place Laravel application in a subdirectory “subFolderApp1”. Example

[…]

Read More…

Nginx Config for Laravel Application

Here is Nginx configuration for a laravel application

Nginx Config for Laravel Application in sub folder […]

Read More…

Disable TLSv1 in Nginx

nmap

To disable TLSv1 in nginx, add

in your server config. if you are using letsencrypt SSL, edit file

Find

Replace with

Restart Nginx

To verify, run

This will list all supported SSL protocols. Nginx SSL Configuration See Nginx […]

Read More…

Nginx Rails Origin header didn’t match request.base_url

Nginx Web Server

After installing SSL on Nginx server, rails application login page stopped working. On log file (log/production.log), found following error HTTP Origin header (https://domain.com) didn’t match request.base_url (http://domain.com) The Nginx config used was

The problem is solved by adding following to nginx config.

The new config is

See Nginx […]

Read More…

Enable Directory Listing in Nginx

To enable directory listing in Nginx, add following to server configuration.

Example

If you need it for a specific folder, add

[…]

Read More…

Nginx Configuration for Video Streaming With Secure Link

here is nginx configuration i used for a video site that have secure link.

This video server is a storage server in vShare Youtube Clone script. […]

Read More…

Nginx 413 Request Entity Too Large

On Nginx server, when uploading large file, i get error

On nginx error log

To fix, edit nginx config for the web site, under the server section of the web site, add

Restart nginx.

[…]

Read More…

Nginx CloudFlare restore real ip

When using Nginx Behind Cloudflare, logs and web applications show cloudflare sever IP instead of visitor IP. To fix this, edit

Inside “http” section, add

You can get updated list of CloudFlare IPs from https://www.cloudflare.com/ips/ Restart Nginx with

Example Nginx Config https://gist.github.com/serverok/fef5c76bf96f8e016bf64095da4a64dc […]

Read More…