ped*_*ram 5 nginx vue.js vue-router
我有两个位置由 nginx 提供服务。我希望所有/api/*
路径都由 uwsgi 服务器提供,并且所有其他/
路径由 index.html 提供服务。我正在使用 Vue Router,所以我也需要这个try_files $uri $uri/ /index.html;
这是我的完整配置,适用于 /,但不能正确排除 /api
server {
listen 8080;
location ^~ /api {
include uwsgi_params;
uwsgi_pass localhost:9000;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
location ~ ^(?!/api).+ { { # this doesn't work. i'm trying to ignore /api/* for the rule below.
try_files $uri $uri/ /index.html;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
851 次 |
最近记录: |