Files
juzi/rednote/deploy/nginx-rednote.locations.conf

43 lines
1.4 KiB
Plaintext

# Insert into the EXISTING HTTPS server during an authorized deployment.
# Retain all /state/, /api/, TLS and WeChat verification locations unchanged.
location = /rednote {
return 301 /rednote/;
}
location = /rednote/admin.html {
auth_basic "juzi admin";
auth_basic_user_file /etc/nginx/.htpasswd-juzi;
proxy_pass http://127.0.0.1:8081/admin.html;
proxy_set_header Host $host;
}
location = /rednote/css/admin.css {
auth_basic "juzi admin";
auth_basic_user_file /etc/nginx/.htpasswd-juzi;
proxy_pass http://127.0.0.1:8081/css/admin.css;
}
location = /rednote/js/admin.js {
auth_basic "juzi admin";
auth_basic_user_file /etc/nginx/.htpasswd-juzi;
proxy_pass http://127.0.0.1:8081/js/admin.js;
}
location ^~ /rednote/api/admin/ {
auth_basic "juzi admin";
auth_basic_user_file /etc/nginx/.htpasswd-juzi;
proxy_pass http://127.0.0.1:8081/api/admin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 150s;
}
location ^~ /rednote/data/ {
return 404;
}
location /rednote/ {
client_max_body_size 20m;
proxy_pass http://127.0.0.1:8081/;
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_read_timeout 150s;
}