Skip to content

Commit

Permalink
Fix: readded hardening configuration to external nginx (#98)
Browse files Browse the repository at this point in the history
Co-authored-by: 0xAnansi <[email protected]>
  • Loading branch information
0xAnansi and 0xAnansi authored Jun 28, 2023
1 parent 6ebe1a1 commit 2499847
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,33 @@ server {
ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem;


ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets on;
ssl_stapling on;
ssl_stapling_verify on;

# Hide nginx version
server_tokens off;

# Enable compression for JS/CSS/HTML bundle, for improved client load times.
# It might be nice to compress JSON, but leaving that out to protect against potential
# compression+encryption information leak attacks like BREACH.
gzip on;
gzip_types text/css application/javascript image/svg+xml;
gzip_vary on;

# Various content security headers
add_header Referrer-Policy "same-origin";
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "DENY";
add_header X-XSS-Protection "1; mode=block";


location / {
proxy_pass http://0.0.0.0:{{lemmy_port}};
proxy_http_version 1.1;
Expand Down

0 comments on commit 2499847

Please sign in to comment.