Reverse proxy, subdomain

Cliff Wells cliff at develix.com
Mon Feb 27 17:52:10 UTC 2012


On Mon, 2012-02-27 at 12:19 +0100, vicosoft at gmail.com wrote:
> ok, I've solved using the IF statement.
if ($http_host = m.mua.es) {

No, this is a bad way to solve it. Please see
http://wiki.nginx.org/IfIsEvil

Instead, set up a separate server block for that subdomain:

server {
    server_name m.mua.es;
    ...
}

If you want to avoid repeating large blocks of configuration across
multiple server blocks, use the include directive.

Regards,
Cliff




More information about the nginx mailing list