mytfenv/nginx.conf
2026-11-13 12:48:00 -06:00

42 lines
1.4 KiB
Nginx Configuration File

events { worker_connections 1024; }
http {
client_max_body_size 0;
map "$http_host|$upstream_http_www_authenticate" $registry_www_auth {
"~^registry\.local:3005\|(?<pre>.*realm=\")https?://forgejo:3000(?<post>.*)$"
"${pre}https://registry.local:3005${post}";
default $upstream_http_www_authenticate;
}
# BLOCK 1: HTTPS (Port 443) - Für die Pipeline
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
proxy_pass http://forgejo: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_hide_header WWW-Authenticate;
add_header WWW-Authenticate $registry_www_auth always;
}
}
# BLOCK 2: HTTP (Port 80) - Für deinen SSH-Tunnel
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://forgejo: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;
}
}
}