Sub-domains through different /etc/nginx/sites-enabled entries?

Johannes Graumann johannes_graumann at web.de
Fri Aug 3 08:03:04 UTC 2012


Hello,

I'm refining here my question that remained unanswered under the topic 
"Distribution of requests to multiple lxc containers" ...

Is it possible to distribute sub-domains of one domain through independent 
files/links in sites-available/sites-enables entries? I'd love to have the 
flexibility to enable/disable services running at different sub-domains 
without having to edit a (joined) file/link, but with the two entries below 
requests to "mail.MYDOMAIN.org" (trying to reach a lxc 
container (supposedly) proxied by the second entry) end up returning an 
error produced by the the first one.

Thanks for any pointers on what I might be doing wrong or whether I have to 
resort to one sites-available/enabled file.

Joh

> server {
>         listen   443;
>         server_name  MYDOMAIN.org HOSTING.net;
>         client_max_body_size 40M;
>         # SSL is using CACert credentials
>         ssl  on;
>         ssl_certificate  /etc/ssl/private/cacert.MYDOMAIN.org.pem;
>         ssl_certificate_key 
/etc/ssl/private/cacert.MYDOMAIN.org_privatkey.pem;
>         ssl_session_timeout  5m;
>         ssl_protocols  SSLv3 TLSv1;
>         ssl_ciphers  ALL:!ADH:!EXPORT56:!LOW:RC4+RSA:+HIGH:+MEDIUM:+SSLv3:
+EXP;
>         ssl_prefer_server_ciphers   on;
>         # Proxy the "plone.MYDOMAIN.org" lxc container
>         location / {
>                 proxy_pass 
http://10.10.10.2:8080/VirtualHostBase/https/HOSTING.net:443/MYDOMAINPlone/VirtualHostRoot/;
>         }
> }


> server {
>         listen   443;
>         server_name  mail.MYDOMAIN.org mail.HOSTING.net;
>         client_max_body_size 40M;
>         # SSL is using CACert credentials
>         ssl  on;
>         ssl_certificate  /etc/ssl/private/cacert.MYDOMAIN.org.pem;
>         ssl_certificate_key  
/etc/ssl/private/cacert.MYDOMAIN.org_privatkey.pem;
>         ssl_session_timeout  5m;
>         ssl_protocols  SSLv3 TLSv1;
>         ssl_ciphers  ALL:!ADH:!EXPORT56:!LOW:RC4+RSA:+HIGH:+MEDIUM:+SSLv3:
+EXP;
>         ssl_prefer_server_ciphers   on;
>         # Proxy the "kolab.MYDOMAIN.org" lxc container
>         location / {
>                 proxy_pass http://10.10.10.4;
>         }
> }




More information about the nginx mailing list