Configure Nginx

This seems complicated. However, I didn't want to re-invent the wheel, so I used the info in

When I got to this point, I had already gone part way down the LEMP installation instructions from digitalocean, so had already set up config for PHP-FPM to use unix sockets as instructed in there.

So going through the Drupal Nginx group instructions, I modified them for Unix sockets, not TCP

Also, the user was altered from www-data to nginx - that was how the php config was done and the nginx user exists after installing nginx in the way I did.

Make a copy of and name it for your site (in my case
If like me you are familiar with Apache configuration, this is the equivalent of the virtualhost.conf file for apache.

Change all references to to your site's address ( in my case).

Because this is only for a subdomain, and I don't want it to redirect to the 2nd level (ie I commented out both "## Return (no rewrite) server" blocks in

My server doesn't have IPV6 support so I commented those lines.

Check the carefully documented section regarding Drupal modules etc. and un-comment any you are using (none in my case)

Save the file.

Create an /etc/nginx/sites-enabled directory. Symlink your conf file into the sites-enabled directory.

Checking through the Drupal Nginx group instructions on php-fpm. I spotted another directive, and changed

chdir = /var/www/vhosts/

At this point I restarted the nginx server, and got failures.

  • The certificates for SSL weren't found (as I haven't installed them yet)
    - I simply commented them out in the nginx.conf for now
  • upload_progress was causing a fail.
    - as I'm not uploading anything to this site, again I commented the directive out.
  • Directories / files didn't exist (log files etc). I created them and made them owned by nginx

nginx then started and the same test page was served when http://<ip-address> was visited in a browser.