location /api/ {
client_max_body_size 2000m;
proxy_pass http://127.0.0.1:2020/;
}
这里如果你的dist包 跟你的jar包在同一服务器上的时候进行配置的 只需要改一下端口就万事大吉了,但是注意的末尾必须是要有/的,别问为啥,因为那个后端不会
location / {
root /var/www/compilation-smart/html/;
index index.html index.htm;
client_max_body_size 150M;
try_files $uri $uri/ /index.html;
}
这段代码:主要的那句代码是try_files 这句话的代码是你一刷新,就404了,嘿嘿