nginx 配置
配置文件上传大小
client_max_body_size 40m;
保存后 nginx -s reload 后还是不行,
解决:taskkill /f /im nginx.exe命令杀死进程,再stat nginx
配置vue
server {
listen 8192;
server_name localhost;
client_max_body_size 500m;
proxy_max_temp_file_size 500m;
location / {
root /home/dist/;
try_files $uri $uri/ /index.html;
}
location /api/base/
{
proxy_pass http://localhost:4483;
}
location /api/business/
{
proxy_pass http://localhost:4483;
}
location /wwww/.*\.(docx|doc)
{
proxy_pass http://localhost:4483;
}
location ~ .*\.(docx)$
{
#proxy_pass http://localhost:4483;
root /home/wwwroot/download/;
}
#location ~ .*\.(docx)$
#{
# proxy_pass http://localhost:4483;
#}
}
单个端口,用路径区分,配置2个vue项目
server {
listen 8321;
server_name localhost;
location /map/ {
# root /home/dist;
alias /home/map/;
index index.html index.htm;
}
location / {
root /home/map/;
index index.html index.htm;
}
location /bs/ {
# root /home/dist;
alias /home/water/;
index index.html index.htm;
}
location /App_Data/AduitFiles/ {
root /home/webhost;
}
location ^~ /static/outlet/ {
rewrite ^/(.*) http://localhost:8321/#/$1 last;
}
# location /api/ {
# proxy_pass http://localhost:4402/api/;
# }
location /api/ {
proxy_pass http://localhost:8328/api/;
}
}