SteveLTN / https-portal

A fully automated HTTPS server powered by Nginx, Let's Encrypt and Docker.
MIT License
4.42k stars 296 forks source link

Getting rid of `if ($host != $server_name) {` #263

Closed MarcelWaldvogel closed 3 years ago

MarcelWaldvogel commented 3 years ago
    # Prevent Nginx from leaking other server configurations on the same machine
    if ($host != $server_name) {
        return 444;
    }

All configuration files contain this block. nginx documentation recommends to avoid if blocks whenever possible, because if is evil.

I guess the same functionality could also be achieved by creating a server block which is included before any of the conf.d/* files. What do you think?

SteveLTN commented 3 years ago

Yes, this can be removed now as later I implemented this block.

(And the self-signed certs are for this block)

SteveLTN commented 3 years ago

I deleted this block. Closing this issue and will come in the next release.