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.xxxthanks!
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.
精彩评论