Nginx Web Server

Tips, tricks, tutorials and troubleshooting articles for the Nginx web server

Nginx (pronounced "Engine-X") is an open source Web server and a reverse proxy server with a strong focus on high concurrency, performance and low memory usage. It can deploy dynamic HTTP content on a network using FastCGI, SCGI handlers for scripts, uWSGI application servers or Phusion Passenger module, and can serve as a software load balancer.

I don't use Nginx currently on any of my own web servers, but I do manage a customers images server which uses Nginx.

Post sort order: Post Date (Newest First) | Post Date (Oldest First) | Alphabetical | Date Updated

Browser responses to the X-Frame-Options response header

Posted in Apache and Nginx Web Server -

The X-Frame-Options response header this morning; it can be used to prevent your website being rendered within a <frame>, <iframe> or <object>. There are different options to either deny access to all websites, allow from the same origin only, and to allow from a specific origin.

301 all URLs but one with Nginx

Posted in Nginx Web Server -

There may be times you need to redirect all requests away from a domain except for a single URL, for example when redirecting all requests from http to https but leaving one file accessible under http for validation purposes. This post shows how to do this with the Nginx web server.

Fix "access denied" error when parsing HTML as PHP with Nginx

Posted in Nginx Web Server and PHP -

If you are attempting to get files with a .html extension parsed as PHP with Nginx + php-fpm, you might get an "access denied" error in your browser, and the error message "Access to the script '...' has been denied (see security.limit_extensions)" in your Nginx error log. This post shows how to allow html files to be parsed successfully as PHP with Nginx + php-fpm.

502 Bad Gateway error after upgrading Nginx and/or PHP

Posted in Nginx Web Server and PHP -

After doing an upgrade on my Debian virtual server, which upgraded PHP and Nginx, I got a "502 Bad Gateway" error when browsing websites on that server. This post shows how to fix this problem, and the configuration option to prevent it occurring again on reboot.

PHP upload_max_filesize and nginx

Posted in Nginx Web Server and PHP -

I've recently set up a new server with PHP & Nginx using packages from dotdeb. The default upload_max_filesize and post_max_size for this setup with php-fpm is 2M. To adjust it, the Nginx config also needs a configuration change, otherwise you're still stuck with a 2MB limit.

Fix Argument cannot be null, Parameter name: path on Nginx/Mono

Posted in Linux/Unix/BSD and Nginx Web Server -

When migrating a mono application / web service running on one server to a new server I got an error telling me that the "Argument cannot be null" and "Parameter name: path". This post shows the full error message and the additional configuration options that needed to be set to fix it.

Get the arguments used to configure Nginx source

Posted in Nginx Web Server -

I'm currently managing an images server for a customer that uses Nginx on an old Debian 5 install. At some point they installed a version of Nginx from source, and I wanted to be able to install an updated version from source using the same command line arguments for the configure command.