View Single Post
  #3  
Old 25th August 2011, 15:41
GarGamel55 GarGamel55 is offline
Member
 
Join Date: Jul 2011
Posts: 30
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Thanks Falko,

But this rules doesn't work for me (redirect loop error)

However, I'm inspired by your idea and I just created a virtual host like this www.domain.tld in /etc/nginx/sites-enabled/

In this file, I wrote :

Code:
server {
        server_name www.domain.tld;

        location ~* \.(jpg|jpeg|gif|css|png|js|ico|swf|mp3)$ {
        #replace $host by domain without www.
        root   /var/www/domain.tld/web;
        expires       7d;
        access_log     off;
        }

        location / {
        proxy_pass http://127.0.0.1:82;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        access_log off;
        }
}
And all is ok. Nginx catch all statics and apache php

Voilą !
__________________
French webmaster

Last edited by GarGamel55; 25th August 2011 at 15:43.
Reply With Quote