Skip to content

Instantly share code, notes, and snippets.

@rhrn
Last active May 11, 2018 08:15
Show Gist options
  • Save rhrn/0ec40597431b02c4abba652f044f01a6 to your computer and use it in GitHub Desktop.
Save rhrn/0ec40597431b02c4abba652f044f01a6 to your computer and use it in GitHub Desktop.
upstream custom-service-upstream {
server custom-service:80;
}
server {
listen 8080;
server_name example.com;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 8443 ssl http2;
server_name example.com;
client_max_body_size 4G;
keepalive_timeout 10m;
ssl on;
ssl_dhparam /run/secrets/dhparam.pem;
ssl_certificate /run/secrets/example.com.cert;
ssl_certificate_key /run/secrets/example.com.privkey;
ssl_trusted_certificate /run/secrets/example.com.chain;
ssl_session_timeout 10m;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://custom-service-upstream;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment