Files
token-list-share/deploy/nginx.conf.example
2026-09-14 09:10:16 +08:00

38 lines
1.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 1Panel 新建一个独立网站(例如 token.example.com把这段贴进该站点配置。
# 不要改 sub2api.example.com 现有的 location ^~ /。
#
# 静态文件放到该站点网站目录,一般是:
# /www/sites/token.example.com/index/
# 把 dist 里的文件直接放进去,不要多套一层 dist/。
#
# /api/ 反代到本机 Sub2API8080。页面自己带 x-api-key。
server {
listen 80;
listen 443 ssl http2;
server_name token.example.com;
root /www/sites/token.example.com/index;
index index.html;
# 1Panel 会自动插入证书、gzip 等,这里只保留业务 location。
location /api/ {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
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 Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
location / {
try_files $uri $uri/ /index.html;
}
}