如何解决使用服务器配置在Nginx中进行URL重写
我想在每个Web请求上重写一个URL。
因为我的访客知道URl,但我将其存储在另一个位置。
所以我做到了:
#Names a server and declares the listening port
server {
listen 80;
server_name 10.37.1.85 images-raw.fn.fr;
#Configures the publicly served root directory
#Configures the index file to be served
root /web/images-raw.fnaim.fr;
index index.html index.htm index.PHP;
location / {
rewrite_log on;
rewrite ^images1/img([0-9]*)/([\w/-_]*).(jpg|JPG)$ /get_image.pp.PHP?name=/$2 last;
try_files $uri $uri/ =404;
}
location ~ \.PHP$ {
include snippets/fastcgi-PHP.conf;
fastcgi_pass unix:/var/run/PHP5-fpm.sock;
}
但是我的重定向根本不起作用。
我要写什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。