czsjCRM-vue/nginx.conf

32 lines
977 B
Nginx Configuration File
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{
# 监听本地的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/;
}
}