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…

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

[…]

Read More…

Nginx Config for rtmp streaming

Here is nginx config used for RTMP streaming.

[…]

Read More…

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.

Nginx […]

Read More…

Moving from Apache PHP 5 to Nginx PHP 7

Today i moved a high traffic WordPress web using from Apache + PHP 5 to Nginx + PHP 7.2. Here is a graph provided by LiquidWeb (server provider). With Apache, load was like 8. [email protected]:/etc/php# uptime 12:35:01 up 14:33, 1 user, load average: 8.03, 6.66, 5.84 [email protected]:/etc/php# After switching to Nginx + PHP-FPM, load come […]

Read More…

Magento 1.9 Nginx Configuration

Here is Nginx + php-fpm config for Magento 1.9 on Ubuntu 16.04/Debian 9.

[…]

Read More…

Nginx upstream timed out

Edit nginx.conf

Inside http {} block, add

See nginx […]

Read More…

Nginx configuration for aMember

Here is Nginx configuration for aMember script

See Nginx […]

Read More…

Nginx Redirect

Redirect site from www to non-www Redirect www domain to non-www

If you use custom ports, use

Redirect Naked Domain to www

Redirect a site to HTTPS

To redirect a specific URL to another URL

If you want to redirect a URL that matches specific pattern, use

[…]

Read More…