首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >询问使用nginx重写timthumb

询问使用nginx重写timthumb
EN

Stack Overflow用户
提问于 2015-07-30 18:50:55
回答 1查看 329关注 0票数 0

这是我创建的nginx.conf,

代码语言:javascript
复制
location / {
try_files $uri $uri/ /index.php?q=$request_uri&$args;
rewrite ^thumb/([^/]+)x([^/]+)/(.*) timthumb.php?src=http://$3&h=$2&w=$1 last;
}

但是,我得到了错误404 nginx,我必须做什么?谢谢

EN

回答 1

Stack Overflow用户

发布于 2015-07-31 09:11:08

好吧,我自己找到答案了

代码语言:javascript
复制
  location ~* \.(js|css|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|wml|swf|pdf|doc|docx|ppt|pptx|zip)$ {
   expires max;
   log_not_found off;
   add_header Pragma public;
   add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location / {
rewrite ^/thumb/([0-9]+)x([0-9]+)_(.*) /timthumb.php?src=http://$3&h=$2&w=$1 last;
try_files $uri $uri/ /index.php?q=$request_uri&$args;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31721768

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档