【发布时间】:2017-05-21 14:40:41
【问题描述】:
我似乎总是对 nginx 配置有问题。我的 SPA 位于 /mnt/q/app(已启用推送状态),前端根位于 client/public。一切都应该映射到 index.html,应用程序会在其中选择路线并决定要做什么。
索引的完整路径是/mnt/q/app/client/public/index.html。
我想我现在已经没有选择了。不管我做什么,我只是从 nginx 得到一个 404,我认为配置很简单,不知道出了什么问题。
server {
listen 80;
server_name app.dev;
root /mnt/q/app;
location / {
root /client/public;
try_files $uri @rewrites =404;
}
location @rewrites {
rewrite ^(.+)$ /index.html last;
}
}
感谢任何帮助。
【问题讨论】:
标签: nginx single-page-application aurelia