feat: 准备 Admin 线上 HTTPS 部署 (#81)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# 将域名和证书路径替换为实际值后放入服务器 Nginx 配置目录。
|
||||
# Admin 本身只监听 127.0.0.1:18080,不直接开放公网端口。
|
||||
server {
|
||||
listen 80;
|
||||
server_name admin.example.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name admin.example.com;
|
||||
|
||||
ssl_certificate /path/to/fullchain.pem;
|
||||
ssl_certificate_key /path/to/privkey.pem;
|
||||
|
||||
client_max_body_size 20m;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:18080;
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user