How to configure nginx

Note:
This documentation has moved to a new home! Please update your bookmarks to the new URL for the up-to-date version of this page.

Are you sure that

server {
        listen                443 ssl;
        root                  /var/www/html;
        return                301 https://$host$request_url;

is correct? That server block is listening on port 443 only, so the client is already on HTTPS, so no reason to redirect. This should cause a redirect loop. The redirect should happen in a server block listening to port 80.

I have made revisions to the post (with a secondary OK from the Server Team), and have revised the configuration to have a separate server block for listening on port 80 for the HTTP-to-HTTPS redirect.

For Multi Site Hosting it says you should have unique port numbers.
A bit misleading.

cc @bryce

FYI I removed that component from the entries. You’re right multisite doesn’t need multiple ports in NGINX. Especially for multiple domains. The exception is if you have docker containers, etc. running things.