61 lines
2.1 KiB
Plaintext
61 lines
2.1 KiB
Plaintext
server {
|
|
server_name git.theschricks.com;
|
|
|
|
location / {
|
|
|
|
# Workaround while waiting for cookie flags to be implemented. See Issue #5583
|
|
proxy_cookie_path / "/; Secure; HttpOnly; SameSite=lax";
|
|
|
|
proxy_pass http://pi1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
if ($scheme != "https") {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
client_max_body_size 512m;
|
|
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
listen 443 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/git.theschricks.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/git.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=()";
|
|
|
|
#Ideally needs to be changed, but needs to be set to this for Gitea for now: https://github.com/go-gitea/gitea/issues/305.
|
|
add_header Content-Security-Policy "default-src 'self'; base-uri 'none'; connect-src 'self'; frame-ancestors 'self'; font-src 'self' data:; form-action 'self'; img-src 'self' https: data:; manifest-src 'self' data:; object-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; worker-src 'self';";
|
|
|
|
# OCSP stapling
|
|
ssl_stapling on;
|
|
ssl_stapling_verify on;
|
|
|
|
}
|
|
|
|
#HTTP
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name git.theschricks.com www.git.theschricks.com;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
#Redirect www
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
server_name www.git.theschricks.com;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|