58 lines
1.6 KiB
Plaintext
58 lines
1.6 KiB
Plaintext
#HTTPS
|
|
server {
|
|
|
|
root /var/www/element.theschricks.com/element-latest;
|
|
|
|
index index.html;
|
|
|
|
server_name element.theschricks.com;
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";
|
|
}
|
|
|
|
client_max_body_size 512m;
|
|
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
listen 443 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/element.theschricks.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/element.theschricks.com/privkey.pem; # managed by Certbot
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
add_header X-Content-Type-Options nosniff;
|
|
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
|
|
add_header X-Robots-Tag none;
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
add_header Referrer-Policy "strict-origin";
|
|
add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()";
|
|
|
|
# CSP
|
|
add_header Content-Security-Policy "frame-ancestors 'self'";
|
|
|
|
# OCSP stapling
|
|
ssl_stapling on;
|
|
ssl_stapling_verify on;
|
|
|
|
#return 301 https://$host$request_uri;
|
|
}
|
|
|
|
#HTTP
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name element.theschricks.com www.element.theschricks.com;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
#Redirect www
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
server_name www.element.theschricks.com;
|
|
return 301 https://$host$request_uri;
|
|
}
|