server{
client_max_body_size 200M;
# 前端端口号
listen 9800;
server_name localhost;
location / {
# dist目录
root /home/nyfy-ui/dist;
index index.html;
try_files $uri $uri/ /index.html;
}
location @router{
rewrite ^.*$ /index.html last;
}
location ^~ /prod-api/ {
proxy_pass http://后端ip:8088/;
}
error_page 500 502 503 504 /50x.html;
}
您可以使用以下命令来启动 Nginx 并指定配置文件的位置:
sudo /usr/sbin/nginx -c /path/to/nginx.conf