38 messages in ru.sysoev.nginxRe: Nginx Drupal Rewrite
FromSent OnAttachments
Claude BingMay 16, 2009 9:09 am 
Michael ShadleMay 16, 2009 9:14 am 
Igor SysoevMay 16, 2009 9:47 am 
Igor SysoevMay 16, 2009 9:47 am 
Claude BingMay 16, 2009 10:04 am 
Igor SysoevMay 16, 2009 10:09 am 
Claude BingMay 16, 2009 10:17 am 
Claude BingMay 16, 2009 10:57 am 
Igor SysoevMay 16, 2009 11:10 am 
AMP AdminMay 16, 2009 11:15 am 
Claude BingMay 16, 2009 11:19 am 
Claude BingMay 16, 2009 11:20 am 
Igor SysoevMay 16, 2009 11:27 am 
Igor SysoevMay 16, 2009 11:27 am 
AMP AdminMay 16, 2009 11:33 am 
Claude BingMay 16, 2009 11:35 am 
Igor SysoevMay 16, 2009 11:42 am 
Claude BingMay 16, 2009 11:53 am 
Igor SysoevMay 16, 2009 12:10 pm 
Claude BingMay 16, 2009 12:20 pm 
Igor SysoevMay 16, 2009 12:46 pm 
Michael ShadleMay 16, 2009 1:45 pm 
Igor SysoevMay 16, 2009 10:47 pm 
Igor SysoevMay 16, 2009 10:54 pm 
Hendry LeeMay 17, 2009 12:42 am 
AMP AdminMay 19, 2009 10:00 am 
Cliff WellsMay 19, 2009 10:06 am 
Michael ShadleMay 19, 2009 10:18 am 
Kon WilmsMay 19, 2009 11:05 am 
Jim OhlsteinMay 19, 2009 11:10 am 
Igor SysoevMay 20, 2009 1:47 am 
Igor SysoevMay 20, 2009 5:28 am 
Hendry LeeMay 20, 2009 6:21 am 
Igor SysoevMay 20, 2009 6:28 am 
Michael ShadleMay 20, 2009 9:43 am 
Hendry LeeMay 20, 2009 10:15 am 
Igor SysoevMay 20, 2009 10:20 am 
Michael ShadleMay 20, 2009 11:57 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Nginx Drupal RewriteActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:May 16, 2009 10:09:39 am
List:ru.sysoev.nginx

On Sat, May 16, 2009 at 07:04:43PM +0200, Claude Bing wrote:

Well I should clarify about the gallery. It's Gallery2, php-driven.

How does typical URL look ?

Where is the } that I should fix?

I have marked the by "+" and "-":

+ }

error_page 404 /index.php;

location ~ /\.ht { deny all; } -} }

2009/5/16 Igor Sysoev <is@rambler-co.ru>

On Sat, May 16, 2009 at 06:09:41PM +0200, Claude Bing wrote:

Ok, I followed a tutorial online and was trying to get rewrite working on my server. Well, everything works ok except for my Photo gallery which is located in | <domain>/gallery |. I'll include my current config for the domain (wfto.cc and wfto.cc/gallery) ======================== server { listen 80; server_name www.waterfortheoppressed.com waterfortheoppressed.com;

rewrite ^ http://wfto.cc permanent; }

server { listen 80; server_name www.wfto.cc wfto.cc;

access_log /var/www/logs/wfto.cc.access.log;

location = / { root /var/www/wfto.cc; index index.php index.html index.htm; } location / { root /var/www/wfto.cc; index index.php index.html;

if (!-f $request_filename) { rewrite ^(.*)$ /index.php?q=$1 last; break; }

if (!-d $request_filename) { rewrite ^(.*)$ /index.php?q=$1 last; break; }

+ }

error_page 404 /index.php;

# serve static files directly location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ { access_log off; expires 30d; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/nginx-default; }

# proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/wfto.cc$fastcgi_script_name; include fastcgi_params; }

# deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } }

- }

First, you should fix '}', Second, use try_files instead of "if"s. And third, your gallery probably is served as static files by

location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {

Yogi Berra <http://www.brainyquote.com/quotes/authors/y/yogi_berra.html> - "If you ask me anything I don't know, I'm not going to answer."