Skip to content

Instantly share code, notes, and snippets.

@bionade24
Last active January 17, 2021 14:24
Show Gist options
  • Save bionade24/966001987ba718557cd0fcc64924938f to your computer and use it in GitHub Desktop.
Save bionade24/966001987ba718557cd0fcc64924938f to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name abs-cd.example.com;
# include includes/le-webroot;
#
# location / {
# return 301 https://$server_name$request_uri;
# }
}
server {
listen 443 http2;
ssl on;
ssl_certificate /etc/fullchain.pem; # path to your cacert.pem
ssl_certificate_key /etc/key.pem; # path to your privkey.pem
server_name abs-cd.example.com;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:5m;
ssl_dhparam /etc/ssl-dhparams.pem;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS';
ssl_prefer_server_ciphers on;
proxy_set_header X-Forwarded-For $remote_addr;
add_header Content-Security-Policy "default-src 'self' data: blob:; script-src 'self'; style-src 'self'";
add_header Content-Security-Policy "upgrade-insecure-requests; ";
add_header Strict-Transport-Security "max-age=31536000";
location /static {
alias /srv/abs_cd/staticfiles;
}
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto https;
access_log /var/log/nginx/abs_cd.access.log;
error_log /var/log/nginx/abs_cd.error.log;
proxy_read_timeout 1200s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment