32 lines
977 B
Nginx Configuration File
32 lines
977 B
Nginx Configuration File
|
|
|||
|
server{
|
|||
|
# 监听本地的80端口
|
|||
|
listen 80;
|
|||
|
server_name localhost;
|
|||
|
# file_upload_size
|
|||
|
client_max_body_size 10M;
|
|||
|
# request_size
|
|||
|
client_body_buffer_size 128k;
|
|||
|
|
|||
|
# 对应的打包文件目录
|
|||
|
#root /usr/share/nginx/food_ui;
|
|||
|
|
|||
|
# history路由需要配置,不然刷新会404
|
|||
|
#try_files $uri $uri/ /index.html;
|
|||
|
|
|||
|
location / {
|
|||
|
root /usr/share/nginx/ruoyi_ui;
|
|||
|
try_files $uri $uri/ /index.html; # 按此顺序查找请求的文件
|
|||
|
index index.html index.htm;
|
|||
|
}
|
|||
|
|
|||
|
# 反向代理,解决跨域
|
|||
|
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://116.62.56.41:8080/;
|
|||
|
}
|
|||
|
}
|