开发者

redirect static files to nginx using .htaccess

I'm running nginx for static files(images, scripts) on 81 port and apache with php on 80. Is it possible to redirect with .htaccess all iamges, styles, scripts requests to the same url but 81 instaed of 80 port?

I'm not very familiar with mod_rewrite

something like if mysite.com/path/file.xxx has extension jpg or png or css

then redirect to mysite.com:8开发者_开发问答1/path/file.xxx

thanks!


Normally you would do it the other away around: have Nginx proxy anything that's not a static file to a backend Apache. Having Apache look at all the incoming requests would defeat the purpose, since you use Nginx to avoid the inefficiencies of Apache when handling numerous requests. http://kbeezie.com/view/apache-with-nginx/ is a reasonable guide to the setup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜