42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name git.timothykim.net;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name git.timothykim.net;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/git.timothykim.net/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/git.timothykim.net/privkey.pem;
|
|
|
|
include /etc/nginx/conf.d/security-headers.inc;
|
|
|
|
# Git push/LFS operations can be large
|
|
client_max_body_size 100M;
|
|
|
|
set $upstream_gitea http://gitea:3000;
|
|
|
|
location / {
|
|
proxy_pass $upstream_gitea;
|
|
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;
|
|
# Gitea API token auth (used by CI runners and git CLI) arrives as
|
|
# Authorization: Basic/Bearer — pass it through explicitly
|
|
proxy_set_header Authorization $http_authorization;
|
|
}
|
|
}
|