Well I should clarify about the gallery. It's Gallery2, php-driven.<br><br>Where is the } that I should fix?<br><br><div class="gmail_quote">2009/5/16 Igor Sysoev <span dir="ltr"><<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Sat, May 16, 2009 at 06:09:41PM +0200, Claude Bing wrote:<br>
<br>
> Ok, I followed a tutorial online and was trying to get rewrite working on my<br>
> server. Well, everything works ok except for my Photo gallery which is<br>
> located in | <domain>/gallery |. I'll include my current config for the<br>
> domain (wfto.cc and wfto.cc/gallery)<br>
> ========================<br>
> server {<br>
> listen 80;<br>
> server_name <a href="http://www.waterfortheoppressed.com" target="_blank">www.waterfortheoppressed.com</a> <a href="http://waterfortheoppressed.com" target="_blank">waterfortheoppressed.com</a>;<br>
><br>
> rewrite ^ <a href="http://wfto.cc" target="_blank">http://wfto.cc</a> permanent;<br>
> }<br>
><br>
> server {<br>
> listen 80;<br>
> server_name <a href="http://www.wfto.cc" target="_blank">www.wfto.cc</a> wfto.cc;<br>
><br>
><br>
> access_log /var/www/logs/wfto.cc.access.log;<br>
><br>
> location = / {<br>
> root /var/www/wfto.cc;<br>
> index index.php index.html index.htm;<br>
> }<br>
> location / {<br>
> root /var/www/wfto.cc;<br>
> index index.php index.html;<br>
><br>
> if (!-f $request_filename) {<br>
> rewrite ^(.*)$ /index.php?q=$1 last;<br>
> break;<br>
> }<br>
><br>
> if (!-d $request_filename) {<br>
> rewrite ^(.*)$ /index.php?q=$1 last;<br>
> break;<br>
> }<br>
<br>
+ }<br>
<br>
> error_page 404 /index.php;<br>
><br>
> # serve static files directly<br>
> location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {<br>
> access_log off;<br>
> expires 30d;<br>
> }<br>
> # redirect server error pages to the static page /50x.html<br>
> #<br>
> error_page 500 502 503 504 /50x.html;<br>
> location = /50x.html {<br>
> root /var/www/nginx-default;<br>
> }<br>
><br>
> # proxy the PHP scripts to Apache listening on <a href="http://127.0.0.1:80" target="_blank">127.0.0.1:80</a><br>
> #<br>
> #location ~ \.php$ {<br>
> #proxy_pass <a href="http://127.0.0.1" target="_blank">http://127.0.0.1</a>;<br>
> #}<br>
><br>
> # pass the PHP scripts to FastCGI server listening on <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a><br>
> #<br>
> location ~ \.php$ {<br>
> fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
> fastcgi_index index.php;<br>
> fastcgi_param SCRIPT_FILENAME<br>
> /var/www/wfto.cc$fastcgi_script_name;<br>
> include fastcgi_params;<br>
> }<br>
><br>
> # deny access to .htaccess files, if Apache's document root<br>
> # concurs with nginx's one<br>
> #<br>
> location ~ /\.ht {<br>
> deny all;<br>
> }<br>
> }<br>
<br>
</div></div>- }<br>
<br>
> }<br>
> ========================<br>
<br>
First, you should fix '}',<br>
Second, use try_files instead of "if"s.<br>
And third, your gallery probably is served as static files by<br>
<div class="im"><br>
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {<br>
<br>
<br>
</div><div><div></div><div class="h5">--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><br><a href="http://www.brainyquote.com/quotes/authors/y/yogi_berra.html" target="_blank">Yogi Berra</a> - "If you ask me anything I don't know, I'm not going to answer."