持续集成:内置部署重启脚本与Nginx配置模板,实现独立端口部署与数据库注入
This commit is contained in:
1 parent
22520b12ee
commit
bd2d5b03c3
3 files changed
+111
-1
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# ==============================================================================
|
||||
# 铁路培训实训教学平台 - Nginx 配置参考模板
|
||||
# 适用于 sict 服务器 (/data2/wzb/deploy)
|
||||
# ==============================================================================
|
||||
|
||||
server {
|
||||
listen 8082; # 业务对外访问端口,可按需修改
|
||||
server_name localhost;
|
||||
|
||||
# 1. 前端静态页面托管
|
||||
location / {
|
||||
root /data2/wzb/deploy/frontend;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
# 2. 后端 API 反向代理 (指向 RuoYi-Vue 后端 8092 端口)
|
||||
location /prod-api/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://127.0.0.1:8092/;
|
||||
}
|
||||
|
||||
# 3. 避免静态资源缓存问题
|
||||
location ~* \.(html)$ {
|
||||
root /data2/wzb/deploy/frontend;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user