【发布时间】:2015-07-13 14:01:49
【问题描述】:
我不知道为什么,但是每次我点击我的页面时都会收到 404,这是我的重写:
rewrite ^dashboard/(.+)$ /dashboard/index.html?path=$1;
作品:
/dashboard/
不起作用(给出 404):
/dashboard/page1
/dashboard/page2
我的重写有什么问题吗?
这是我的服务器文件,rewrite 在 include 中
server{
listen 80;
server_name cleep.us www.cleep.us;
root /usr/share/nginx/html/cleep.us/public;
index index.html index.php;
location / {
try_files $uri $uri/ index.html;
include /usr/share/nginx/conf/cleep.us.conf;
}
}
来自日志的错误:
2015/07/13 01:53:00 [错误] 14712#0: *9613 open() "/usr/share/nginx/html/cleep.us/publicindex.html" 失败(2:没有这样的文件或目录),客户端:24.197.220.192,服务器:cleep.us,请求:“GET /dashboard/clicks HTTP/1.1”,主机:“cleep.us”
【问题讨论】:
-
你能把
nginx的错误日志包括进来吗? -
加了,好像没放斜线什么的