Provide authenticated IP HTTPS access and clarify server UI

This commit is contained in:
Codex
2026-10-11 19:34:20 +08:00
parent 4b62c33ed9
commit fcdf6f27f2
5 changed files with 49 additions and 11 deletions
+2
View File
@@ -14,6 +14,8 @@ if not cert.exists():
if not Path(replacement, 'fullchain.pem').exists():
raise SystemExit('Install a valid origin certificate before configuring HTTPS')
text = text.replace('/etc/letsencrypt/live/kaoyan.fjayson.com/', replacement)
if Path('/etc/letsencrypt/live/186.241.68.230/fullchain.pem').exists():
text += '\n' + (root / 'nginx-ip-origin.conf').read_text()
Path('/etc/nginx/sites-available/kaoyan-studio').write_text(text)
PY
ln -sfn /etc/nginx/sites-available/kaoyan-studio /etc/nginx/sites-enabled/kaoyan-studio
+25
View File
@@ -0,0 +1,25 @@
# An authenticated HTTPS entry while the CDN domain is being configured.
# Uses the server's separately renewed IP certificate and an unused port.
server {
listen 9443 ssl;
listen [::]:9443 ssl;
server_name 186.241.68.230;
ssl_certificate /etc/letsencrypt/live/186.241.68.230/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/186.241.68.230/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
client_max_body_size 100m;
auth_basic "Kaoyan Workbench";
auth_basic_user_file /etc/nginx/kaoyan-studio.htpasswd;
location / {
proxy_pass http://127.0.0.1:8765;
proxy_set_header Host $http_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 https;
proxy_read_timeout 120s;
proxy_hide_header Cache-Control;
add_header Cache-Control "private, no-store" always;
add_header X-Content-Type-Options nosniff always;
add_header X-Frame-Options DENY always;
}
}