apache, nginx reverse proxy and zenphoto
server {
listen 80;
server_name server.com;
rewrite ^/(.*) http://www.server.com/$1 permanent;
}
server {
listen 80;
server_name www.server.com;
access_log /home/user/public_html/server.com/log/access.log;
error_log /home/user/public_html/server.com/log/error.log;
location / {
proxy_pass http://127.0.0.1:8080;
}
location ~* ^.+.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ {
expires 30d;
root /home/user/public_html/server.com/public/;
}
}
This works great, except that I am trying to install ZenPhoto
http://www.site.com/portfolio/folder/image/500/imagename.jpg
To:
http://www.site.com/portfolio/albums/folder/imagename.jpg
What I need to do is exclude from the proxy jpg files that are in the portfolio folder and have "image" in the url.
I found one person who did a complete set of nginx rules for ZenPhoto here
These lines seem relevant:
rewrite "^/(.*)/image/(thumb|[0-9]{1,4})/([^/\\\]+)$" /zp-core/i.php?a=$1&i=$3&s=$2 last;
rewrite ^/(.*)/image/([^/\\\]+)$ /zp-core/i.php?a=$1&i=$2 last;
Any ideas?
Thanks!
1 Reply
location ~* ^/((?!portfolio).).+.((?!image|album).).+.(jpe?g) {
expires 30d;
root /home/user/public_html/site.com/public/;
}