feat: Add git.dociva.io reverse proxy for Gitea
This commit is contained in:
@@ -14,6 +14,20 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
# --- Gitea HTTP (ACME + redirect) ---
|
||||
server {
|
||||
listen 80;
|
||||
server_name git.dociva.io;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 308 https://git.dociva.io$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
# Redirect www to non-www
|
||||
server {
|
||||
listen 443 ssl;
|
||||
@@ -114,3 +128,40 @@ server {
|
||||
proxy_pass http://$backend_upstream/api/health;
|
||||
}
|
||||
}
|
||||
|
||||
# --- Gitea HTTPS reverse proxy ---
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name git.dociva.io;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/git.dociva.io/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/git.dociva.io/privkey.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
client_max_body_size 100M;
|
||||
resolver 127.0.0.11 valid=30s ipv6=off;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
|
||||
location / {
|
||||
proxy_pass http://gitea:3000;
|
||||
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;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
}
|
||||
}
|
||||
|
||||
# Used by Gitea (and other WS-enabled apps)
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user