Disable TLSv1 in Nginx

To disable TLSv1 in nginx, add

in your server config.

if you are using letsencrypt SSL, edit file


Replace with

Restart Nginx

To verify, run

This will list all supported SSL protocols.


Nginx Web Server

Nginx Rails Origin header didn’t match request.base_url

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

Nginx Web Server

Nginx Disable Access log

On a high traffic web site, i want to disable access log as we are hitting I/O Limit. Since we don’t use this access log for anything now, there is no point keep writing it to a file. To disable, you need to add following to server entry for your web site.

Here is an example nginx config with access logs disabled.

Enable Directory Listing in Nginx

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


If you need it for a specific folder, add

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.

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.

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


Restart Nginx with

Example Nginx Config


Disable Access to a folder in Nginx

To disable access to folder /admin in Nginx, add following to server block of your web site.

To disable access to some common virtual control software, use

Nginx Config for rtmp streaming

Here is nginx config used for RTMP streaming.

Nginx wildcard virtualhost

wildcard virtual host allow you to host multiple web sites with one configuration file.

Here is what i use for bizhat.com free hosting sub domains.