Skip to content

Instantly share code, notes, and snippets.

@soupdiver
Last active August 29, 2015 14:04
Show Gist options
  • Save soupdiver/97929f64207e3d6130b8 to your computer and use it in GitHub Desktop.
Save soupdiver/97929f64207e3d6130b8 to your computer and use it in GitHub Desktop.
nginx example configuration for using docker-automx by @soupdiver
server {
listen 80;
listen [::]:80;
server_name autoconfig.YOURDOMAIN;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name autoconfig.YOURDOMAIN;
add_header Strict-Transport-Security max-age=63072000;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:7000;
}
ssl on;
ssl_certificate PATH_TO_CRT;
ssl_certificate_key PATH_TO_KEY;
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:!CAMELLIA:!DES:!MD5:!PSK:!RC4';
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache builtin:1000 shared:SSL:10m;
add_header X-Frame-Options DENY;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.4.4 8.8.8.8 valid=300s;
resolver_timeout 5s;
access_log /var/log/nginx/access_log;
error_log /var/log/nginx/error_log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment