66 lines
1.9 KiB
Text
66 lines
1.9 KiB
Text
|
map $http_upgrade $connection_upgrade {
|
||
|
default upgrade;
|
||
|
'' close;
|
||
|
}
|
||
|
|
||
|
upstream gitea {
|
||
|
server 192.168.1.215:3000;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
|
||
|
server_name git.shad.moe www.git.shad.moe;
|
||
|
|
||
|
location / {
|
||
|
return 301 https://$host$request_uri;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 443 ssl;
|
||
|
listen [::]:443 ssl;
|
||
|
|
||
|
http2 on;
|
||
|
|
||
|
server_name git.shad.moe www.git.shad.moe;
|
||
|
|
||
|
ssl_certificate /etc/letsencrypt/live/git.shad.moe/fullchain.pem;
|
||
|
ssl_certificate_key /etc/letsencrypt/live/git.shad.moe/privkey.pem;
|
||
|
ssl_session_timeout 1d;
|
||
|
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
|
||
|
ssl_session_tickets off;
|
||
|
|
||
|
ssl_dhparam /etc/nginx/dhparam.txt;
|
||
|
|
||
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||
|
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
|
||
|
ssl_prefer_server_ciphers off;
|
||
|
|
||
|
add_header Strict-Transport-Security "max-age=63072000" always;
|
||
|
|
||
|
include snippets/http-cat-error-pages.conf;
|
||
|
|
||
|
location / {
|
||
|
client_max_body_size 512M;
|
||
|
proxy_pass http://gitea;
|
||
|
proxy_set_header Connection $http_connection;
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
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-Proto $scheme;
|
||
|
}
|
||
|
|
||
|
ssl_stapling on;
|
||
|
ssl_stapling_verify on;
|
||
|
|
||
|
# verify chain of trust of OCSP response using Root CA and Intermediate certs
|
||
|
ssl_trusted_certificate /etc/letsencrypt/live/git.shad.moe/fullchain.pem;
|
||
|
|
||
|
# replace with the IP address of your resolver
|
||
|
#resolver 127.0.0.1; # Defined in error pages
|
||
|
|
||
|
}
|