小编mah*_*ard的帖子

嵌套位置无法正常工作

我不能调试这块nginx的配置:
我想一些头添加到了所有的请求.pdf文件,
然后我想删除一个令牌,我添加到我的教职员目录,以避免不必要的浏览器缓存:

location /static {
    location ~* \.pdf$ {
        add_header Access-Control-Allow-Origin *;
        add_header Content-Disposition 'inline';
    }
    #Remove Anti cache token
    rewrite "^/static[0-9]{10}/(.*)$" /static/$1 last;
    ...
}
Run Code Online (Sandbox Code Playgroud)

没有 nginx 语法错误,但请求.pdffor 显示 404 not found 错误意味着重写不适用于请求。

非常感谢任何帮助
谢谢

configuration nginx web-server

5
推荐指数
1
解决办法
4530
查看次数

标签 统计

configuration ×1

nginx ×1

web-server ×1