53 lines
1.5 KiB
Plaintext
53 lines
1.5 KiB
Plaintext
# AIOS GitOps alias for https://g.cnnetmkt.top/
|
|
# Note: this server block intentionally keeps /git/ as the Gitea app prefix,
|
|
# matching the current Gitea ROOT_URL and avoiding a disruptive app.ini rewrite.
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
server_name g.cnnetmkt.top;
|
|
|
|
access_log /var/log/nginx/aios-g-cnnetmkt.access.log;
|
|
error_log /var/log/nginx/aios-g-cnnetmkt.error.log;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/cnnetmkt-wildcard/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/cnnetmkt-wildcard/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
location = / {
|
|
return 302 /git/;
|
|
}
|
|
|
|
location = /git {
|
|
return 302 /git/;
|
|
}
|
|
|
|
location /git/ {
|
|
proxy_pass http://127.0.0.1:3000/;
|
|
proxy_http_version 1.1;
|
|
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_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Prefix /git;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_redirect off;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name g.cnnetmkt.top;
|
|
|
|
location = / {
|
|
return 302 https://$host/git/;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|