It says to me when I use try_files "Unknown directive: 'try_files'" and I don't know how to check the version number of nginx<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 class="im">On Sat, May 16, 2009 at 07:58:21PM +0200, Claude Bing wrote:<br>
<br>
> Can I just exclude a directory from rewrite?<br>
> I suppose I can move the gallery to a subdomain.<br>
<br>
</div>You do not need rewrite at all:<br>
<div class="im"><br>
root /var/www/wfto.cc;<br>
</div> index index.php index.html;<br>
<br>
location / {<br>
try_files $uri $uri/ /index.php?q=$uri;<br>
}<br>
<br>
location /gallery/ {<br>
try_files $uri $uri/ /index.php?q=$uri;<br>
<div class="im"> }<br>
<br>
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {<br>
}<br>
<br>
</div><div class="im"> location ~ \.php$ {<br>
fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
</div> ...<br>
<div><div></div><div class="h5"> }<br>
<br>
> 2009/5/16 Claude Bing <<a href="mailto:tehbing@gmail.com">tehbing@gmail.com</a>><br>
><br>
> > K i will attempt to do this in a few minutes. I'll get back to you about<br>
> > the gallery<br>
> ><br>
> ><br>
> > 2009/5/16 Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>><br>
> ><br>
> >> On Sat, May 16, 2009 at 07:04:43PM +0200, Claude Bing wrote:<br>
> >><br>
> >> > Well I should clarify about the gallery. It's Gallery2, php-driven.<br>
> >><br>
> >> How does typical URL look ?<br>
> >><br>
> >> > Where is the } that I should fix?<br>
> >><br>
> >> I have marked the by "+" and "-":<br>
> >><br>
> >> + }<br>
> >><br>
> >> error_page 404 /index.php;<br>
> >><br>
> >> location ~ /\.ht {<br>
> >> deny all;<br>
> >> }<br>
> >> -}<br>
> >> }<br>
> >><br>
> >> > 2009/5/16 Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>><br>
> >> ><br>
> >> > > 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<br>
> >> working on<br>
> >> > > my<br>
> >> > > > server. Well, everything works ok except for my Photo gallery which<br>
> >> is<br>
> >> > > > located in | <domain>/gallery |. I'll include my current config for<br>
> >> 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><br>
> >> > > <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<br>
> >> > > <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>
> >> > > - }<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>
> >> > ><br>
> >> > > location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {<br>
> >> > ><br>
> >> > ><br>
> >> > > --<br>
> >> > > Igor Sysoev<br>
> >> > > <a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
> >> > ><br>
> >> > ><br>
> >> ><br>
> >> ><br>
> >> > --<br>
> >> ><br>
> >> > Yogi Berra <<a href="http://www.brainyquote.com/quotes/authors/y/yogi_berra.html" target="_blank">http://www.brainyquote.com/quotes/authors/y/yogi_berra.html</a>><br>
> >> -<br>
> >> > "If you ask me anything I don't know, I'm not going to answer."<br>
> >><br>
> >> --<br>
> >> ้วฯาุ ๓ูำฯลื<br>
> >> <a href="http://sysoev.ru" target="_blank">http://sysoev.ru</a><br>
> >><br>
> >><br>
> ><br>
> ><br>
> > --<br>
> ><br>
</div></div>> > Bill Cosby <<a href="http://www.brainyquote.com/quotes/authors/b/bill_cosby.html" target="_blank">http://www.brainyquote.com/quotes/authors/b/bill_cosby.html</a>> - "Fatherhood is pretending the present you love most is soap-on-a-rope."<br>
><br>
><br>
><br>
><br>
> --<br>
<div class="im">><br>
> Yogi Berra <<a href="http://www.brainyquote.com/quotes/authors/y/yogi_berra.html" target="_blank">http://www.brainyquote.com/quotes/authors/y/yogi_berra.html</a>> -<br>
> "If you ask me anything I don't know, I'm not going to answer."<br>
<br>
--<br>
</div><div><div></div><div class="h5">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/c/casey_stengel.html" target="_blank">Casey Stengel</a> - "There comes a time in every man's life, and I've had plenty of them."