Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Gallery3 on nginx
PostPosted: Mon Jan 16, 2012 8:42 pm 
Offline
Junior Member

Joined: Sat Jan 07, 2012 4:15 pm
Posts: 23
So I've recently migrated from apache2/mpm-prefork to nginx/php5-fpm with the help of a couple tutorials, and for the main WordPress site that I host, everything is operational; some tweaking lies ahead certainly, but it's operational nonetheless.

I then switched my focus to getting some personal sites working, the first being an installation of Gallery3. First hurdle: php.ini settings, in particular short-tags need to be on. No problem, create a .user.ini file with the proper configuration and that's done. Second hurdle: rewrites. Gallery3 uses an index.php dispatcher which requires some rewrite configuration. I'll admit I'm bad at this (rewrites in general but in particular nginx config rewrites/logic) and, after searching and trial/error, I've got it working. Except it uses if () within location.

Here's my config, if anyone can help me migrate to try_files, I'd be appreciative:

Code:
server {
        listen 80;
        server_name site.com;

        access_log /var/log/nginx/ionly.servebeer_access.log;
        error_log /var/log/nginx/ionly.servebeer_error.log;

        root /home/tom/sites/site.com;
        index index.php index.html index.htm;

        if ($http_host != "site.com") {
                rewrite ^ http://site.com$request_uri permanent;
        }

        include global/restrictions.conf;

        # Additional rules go here.
        location ~.php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME /home/tom/sites/site.com$fastcgi_script_name;
                include fastcgi_params;
        }

        location /gallery3/ {
                if (!-e $request_filename) {
                        rewrite ^/gallery3/index.php/(.+)$ /gallery3/index.php?kohana_uri=$1 last;
                        rewrite ^/gallery3/(.+)$ /gallery3/index.php?kohana_uri=$1 last;
                        rewrite ^/gallery3/$ /gallery3/index.php?kohana_uri=/ last;
                }

        }
}


Edit:
I could not get the suggestions found here to work. All 404.

Edit2:
I also saw this, but I don't understand it. Can anybody comment?


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


Who is online

Users browsing this forum: No registered users and 0 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