Files
guofu-admin/deploy/nginx/clinic.websoft.top.conf.example

38 lines
1.1 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.

server {
listen 443 ssl;
server_name clinic.websoft.top;
# TODO: 替换为你自己的证书路径
# ssl_certificate /path/to/fullchain.pem;
# ssl_certificate_key /path/to/privkey.pem;
root /home/wwwroot/clinic-admin/dist;
index index.html;
# SPA history
location / {
try_files $uri $uri/ /index.html;
}
# 模块接口(对应 VITE_API_URL=/api、VITE_THINK_URL=/api
location /api/ {
proxy_http_version 1.1;
proxy_set_header Host clinic-api.websoft.top;
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_pass https://clinic-api.websoft.top/api/;
}
# 主接口(对应 VITE_SERVER_URL=/server-api
location /server-api/ {
proxy_http_version 1.1;
proxy_set_header Host server.websoft.top;
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_pass https://server.websoft.top/api/;
}
}