105 lines
3.3 KiB
Plaintext
105 lines
3.3 KiB
Plaintext
# Phase 2 candidate for /etc/nginx/sites-available/learn-services.
|
|
#
|
|
# Host Nginx is the only public TLS endpoint. Both virtual hosts forward to the
|
|
# loopback-only Traefik HTTP NodePort; Keycloak is an OIDC provider, not an
|
|
# authentication proxy in front of Gitea.
|
|
|
|
map $http_upgrade $gitea_connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl default_server;
|
|
listen [::]:443 ssl default_server ipv6only=on;
|
|
ssl_reject_handshake on;
|
|
}
|
|
|
|
server {
|
|
server_name git.learn.hyeonworks.com;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:30080;
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Host git.learn.hyeonworks.com;
|
|
proxy_set_header X-Forwarded-Host git.learn.hyeonworks.com;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
proxy_set_header X-Forwarded-Port 443;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $gitea_connection_upgrade;
|
|
proxy_request_buffering off;
|
|
proxy_buffering off;
|
|
proxy_read_timeout 3600s;
|
|
proxy_send_timeout 3600s;
|
|
proxy_redirect off;
|
|
|
|
client_max_body_size 512m;
|
|
}
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/git.learn.hyeonworks.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/git.learn.hyeonworks.com/privkey.pem; # managed by Certbot
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
}
|
|
|
|
server {
|
|
server_name id.learn.hyeonworks.com;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:30080;
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Host id.learn.hyeonworks.com;
|
|
proxy_set_header X-Forwarded-Host id.learn.hyeonworks.com;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
proxy_set_header X-Forwarded-Port 443;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_request_buffering off;
|
|
proxy_buffering off;
|
|
proxy_read_timeout 300s;
|
|
proxy_send_timeout 300s;
|
|
proxy_redirect off;
|
|
|
|
client_max_body_size 10m;
|
|
}
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/git.learn.hyeonworks.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/git.learn.hyeonworks.com/privkey.pem; # managed by Certbot
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
}
|
|
|
|
server {
|
|
if ($host = git.learn.hyeonworks.com) {
|
|
return 301 https://$host$request_uri;
|
|
} # managed by Certbot
|
|
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
server_name git.learn.hyeonworks.com;
|
|
return 404; # managed by Certbot
|
|
}
|
|
|
|
server {
|
|
if ($host = id.learn.hyeonworks.com) {
|
|
return 301 https://$host$request_uri;
|
|
} # managed by Certbot
|
|
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
server_name id.learn.hyeonworks.com;
|
|
return 404; # managed by Certbot
|
|
}
|