为什么此重写规则不起作用?我的另一个规则完美无瑕。原始链接:
http://localhost/t.php?gid=1
这个php文件输出CSS内容
我希望它看起来像这样:
http://localhost/office/1.css
我的重写规则:
rewrite ^/office/([^/]*).css$ /t.php?gid=$1 last;
当我去:
http://localhost/office/1.css
nginx抛出404错误:
[error] 3784#3812: *1 CreateFile() "c:/www/www/office/1.css" failed (3: The system cannot find the path specified)
这是我的服务器块:
您的重写为location /
,但url/office/1.css
属于location ~* \.(css|js|gif|jpeg|png|jpg)$
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句