Hello,
Just started setting up nginx cluster (yippee!), but I'm having a tough time getting nginx to serve local images while forwarding php requests etc to one of the load balanced apache servers.
server {
gzip on;
listen 80;
rewrite ^/resource:shared_gif:(.*).gif$ /home/media/images/$1.gif break;
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;
proxy_pass http://balanced_servers;
}
}
It's sending everything to the balanced servers and that all works fine, but I want nginx to serve the images directly. Can anyone help? Also, any tips on optimzing the nginx in this config I'd appreciate :)