upstream sub_example_com {
server 127.0.0.1:3000 fail_timeout=0;
}
server {
listen 443 ssl;
server_name sub.example.com;
client_max_body_size 4G;
ssl on;
ssl_certificate /path/to/ssl/example.com.crt;
ssl_certificate_key /path/to/ssl/example.com.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate "/path/to/ssl/ca-certs.pem";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'HIGH:!aNULL:!MD5:!kEDH';
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
access_log /var/log/nginx-access.log;
error_log /var/log/nginx-error.log;
try_files $uri @sub_example_com;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://sub_example_com;
}
}
upstream sub.example.com {
server 127.0.0.1:3000 fail_timeot=0;
}
...