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

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 :

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_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 16:43.
Reply With Quote