views:

37

answers:

0

I am looking to set up a secure subdomain on my server. Here is my NGINX configuration... This works but I'm looking for htp[s]://transmission.example.com to proxy pass locally to 127.0.0.1:9091 and htp://example.com to proxy_pass to the app_server.

This works, I can can go to htps://example.com and htp://example.com but I would like to have it only go to the secure server when the transmission subdomain is keyed in.

Any help is appreciated. Thanks!

Nota Bene: Because I don't have 10 rep points I can't actually write out the links so I replaced http:// with htp://

  1 server {
  2   listen   443;
  3   server_name example.com;
  4 
  5   ssl on;
  6   ssl_certificate  /etc/ssl/certs/ssl-cert-snakeoil.pem;
  7   ssl_certificate_key  /etc/ssl/private/ssl-cert-snakeoil.key;
  8 
  9   location / {
 10     proxy_pass          http://127.0.0.1:9091;
 11   }
 12 }
 13 
 14 server {
 15         listen   80;
 16         server_name  example.com www.example.com;
 17 
 18         access_log  /var/log/nginx/localhost.access.log;
 19 
 20         root /var/www/example.com/current/public;
 21 
 22         location / {
 23                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 24                 proxy_set_header Host $http_host;
 25                 proxy_redirect off;
 26
 27                 if (!-f $request_filename) {
 28                     proxy_pass http://app_server;
 29                     break;
 30                 }
 31         }
 32 }