Well I should clarify about the gallery.  It&#39;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">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</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>
&gt; Ok, I followed a tutorial online and was trying to get rewrite working on my<br>
&gt; server.  Well, everything works ok except for my Photo gallery which is<br>
&gt; located in | &lt;domain&gt;/gallery |.  I&#39;ll include my current config for the<br>
&gt; domain (wfto.cc and wfto.cc/gallery)<br>
&gt; ========================<br>
&gt; server {<br>
&gt;         listen 80;<br>
&gt;         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>
&gt;<br>
&gt;         rewrite ^ <a href="http://wfto.cc" target="_blank">http://wfto.cc</a> permanent;<br>
&gt; }<br>
&gt;<br>
&gt; server {<br>
&gt;         listen   80;<br>
&gt;         server_name <a href="http://www.wfto.cc" target="_blank">www.wfto.cc</a>  wfto.cc;<br>
&gt;<br>
&gt;<br>
&gt;         access_log  /var/www/logs/wfto.cc.access.log;<br>
&gt;<br>
&gt;         location = / {<br>
&gt;                 root   /var/www/wfto.cc;<br>
&gt;                 index  index.php index.html index.htm;<br>
&gt;         }<br>
&gt;         location / {<br>
&gt;             root   /var/www/wfto.cc;<br>
&gt;             index  index.php index.html;<br>
&gt;<br>
&gt;             if (!-f $request_filename) {<br>
&gt;                 rewrite  ^(.*)$  /index.php?q=$1  last;<br>
&gt;                 break;<br>
&gt;             }<br>
&gt;<br>
&gt;             if (!-d $request_filename) {<br>
&gt;                 rewrite  ^(.*)$  /index.php?q=$1  last;<br>
&gt;                 break;<br>
&gt;             }<br>
<br>
+         }<br>
<br>
&gt;         error_page  404  /index.php;<br>
&gt;<br>
&gt;         # serve static files directly<br>
&gt;         location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {<br>
&gt;               access_log        off;<br>
&gt;             expires           30d;<br>
&gt;         }<br>
&gt;         # redirect server error pages to the static page /50x.html<br>
&gt;         #<br>
&gt;         error_page   500 502 503 504  /50x.html;<br>
&gt;         location = /50x.html {<br>
&gt;                 root   /var/www/nginx-default;<br>
&gt;         }<br>
&gt;<br>
&gt;         # 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>
&gt;         #<br>
&gt;         #location ~ \.php$ {<br>
&gt;                 #proxy_pass   <a href="http://127.0.0.1" target="_blank">http://127.0.0.1</a>;<br>
&gt;         #}<br>
&gt;<br>
&gt;         # 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>
&gt;         #<br>
&gt;         location ~ \.php$ {<br>
&gt;                 fastcgi_pass   <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
&gt;                 fastcgi_index  index.php;<br>
&gt;                 fastcgi_param  SCRIPT_FILENAME<br>
&gt; /var/www/wfto.cc$fastcgi_script_name;<br>
&gt;                 include        fastcgi_params;<br>
&gt;         }<br>
&gt;<br>
&gt;         # deny access to .htaccess files, if Apache&#39;s document root<br>
&gt;         # concurs with nginx&#39;s one<br>
&gt;         #<br>
&gt;         location ~ /\.ht {<br>
&gt;                 deny  all;<br>
&gt;         }<br>
&gt; }<br>
<br>
</div></div>- }<br>
<br>
&gt; }<br>
&gt; ========================<br>
<br>
First, you should fix &#39;}&#39;,<br>
Second, use try_files instead of &quot;if&quot;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>  - &quot;If you ask me anything I don&#39;t know, I&#39;m not going to answer.&quot;