Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Sep 16, 2009 8:37 pm 
Offline
Senior Newbie

Joined: Thu Mar 26, 2009 9:23 pm
Posts: 12
I'm running apache2 with nginx as a reverse proxy on my Linode 360. This is my nginx config:

Code:
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 and it uses mod_rewrite to change image links from something like:

Code:
http://www.site.com/portfolio/folder/image/500/imagename.jpg


To:

Code:
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:

Code:
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!


Top
   
 Post subject:
PostPosted: Thu Sep 17, 2009 4:06 am 
Offline
Senior Newbie

Joined: Thu Mar 26, 2009 9:23 pm
Posts: 12
I think I'm going to need to do some regular expression homework — it's been a while — but this seems to have done the trick:

Code:
    location ~* ^/((?!portfolio).).+.((?!image|album).).+.(jpe?g) {
        expires 30d;
        root /home/user/public_html/site.com/public/;
    }


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group