Somebody meight be able to help me with my NGNIX config -
trying to get a decent subdomain setup - But I muss a crucial thing somewhere…
I already split up my config files
But as soon as I add the subsubdomain - NGNIX getting into troubles
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
### Update this line to be your IP at the end the ;
server_name *.example.org example.org;
# These shouldn't need to be changed
listen [::]:80 default_server ipv6only=off;
return 301 https://$host$request_uri;
}
server {
### Update this line to be your IP again dont forget at the end the ;
server_name sub.domain.com ;
# Ensure these lines point to your SSL certificate and key (step 3)
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/key.pem;
# These shouldn't need to be changed
listen [::]:443 default_server ipv6only=off; # if your nginx version is >= 1.9.5 you can also add the "h$
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
proxy_buffering off;
location / {
proxy_pass http://127.0.0.1:8123;
proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
Problems starting here:
'''''''''''''''''''''''''''''''''''''
/etc/nginx/sites-available/subsub.domain.com
'''''''''''''''''''''''''''''''''''''
server {
### Update this line to be your IP again dont forget at the end the ;
server_name subsub.domain.com ;
# Ensure these lines point to your SSL certificate and key (step 3)
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/key.pem;
# These shouldn't need to be changed
listen [::]:443 default_server ipv6only=off; # if your nginx version is >= 1.9.5 you can also add the "h$
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
proxy_buffering off;
location / {
proxy_pass http://127.0.0.1:8122;
proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
Thanks - Mixed up our two now and i guess its working fine
''''''''''''
Default
''''''''''''
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
### Update this line to be your URL at the end the ;
server_name *.url.com url.com;
# These shouldn't need to be changed
listen [::]:80 default_server ipv6only=off;
return 301 https://$host$request_uri;
}