30 lines
863 B
Django/Jinja
30 lines
863 B
Django/Jinja
# HTTP server block for Gitea - will be updated by Certbot
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name {{ gitea_domain }};
|
|
|
|
# Allow Let's Encrypt challenges
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/html;
|
|
}
|
|
|
|
# Proxy to Gitea
|
|
location / {
|
|
proxy_pass http://localhost:{{ gitea_port }};
|
|
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;
|
|
|
|
# WebSocket support for Gitea
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
# Timeouts
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
} |