nginx HTTPS serving with same config as HTTP

You can combine this into one server block like so:

server {
    listen 80;
    listen 443 default_server ssl;

    # other directives
}

Official How-To

Leave a Comment