Welcome! Log In Create A New Profile

Advanced

Re: Nginx Drupal Rewrite

May 16, 2009 02:11PM
On Sat, May 16, 2009 at 07:58:21PM +0200, Claude Bing wrote:

> Can I just exclude a directory from rewrite?
> I suppose I can move the gallery to a subdomain.

You do not need rewrite at all:

root /var/www/wfto.cc;
index index.php index.html;

location / {
try_files $uri $uri/ /index.php?q=$uri;
}

location /gallery/ {
try_files $uri $uri/ /index.php?q=$uri;
}

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

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
...
}

> 2009/5/16 Claude Bing <tehbing@gmail.com>
>
> > K i will attempt to do this in a few minutes. I'll get back to you about
> > the gallery
> >
> >
> > 2009/5/16 Igor Sysoev <is@rambler-co.ru>
> >
> >> 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)$ {
> >> > >
> >> > >
> >> > > --
> >> > > Igor Sysoev
> >> > > http://sysoev.ru/en/
> >> > >
> >> > >
> >> >
> >> >
> >> > --
> >> >
> >> > 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."
> >>
> >> --
> >>
Subject Author Posted

Nginx Drupal Rewrite

Claude Bing May 16, 2009 12:09PM

Re: Nginx Drupal Rewrite

mike May 16, 2009 12:15PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 12:48PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 12:47PM

Re: Nginx Drupal Rewrite

Claude Bing May 16, 2009 01:04PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 01:10PM

Re: Nginx Drupal Rewrite

Claude Bing May 16, 2009 01:18PM

Re: Nginx Drupal Rewrite

Claude Bing May 16, 2009 01:58PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 02:11PM

Re: Nginx Drupal Rewrite

Claude Bing May 16, 2009 02:19PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 02:27PM

Re: Nginx Drupal Rewrite

Claude Bing May 16, 2009 02:35PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 02:42PM

Re: Nginx Drupal Rewrite

Claude Bing May 16, 2009 02:54PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 03:11PM

Re: Nginx Drupal Rewrite

Claude Bing May 16, 2009 03:20PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 16, 2009 03:47PM

Re: Nginx Drupal Rewrite

mike May 16, 2009 04:46PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 17, 2009 01:47AM

Re: Nginx Drupal Rewrite

Igor Sysoev May 17, 2009 01:54AM

RE: Nginx Drupal Rewrite

Hendry Lee May 17, 2009 03:43AM

Re: Nginx Drupal Rewrite

Igor Sysoev May 20, 2009 08:29AM

RE: Nginx Drupal Rewrite

Hendry Lee May 20, 2009 09:22AM

Re: Nginx Drupal Rewrite

Igor Sysoev May 20, 2009 09:28AM

Re: Nginx Drupal Rewrite

mike May 20, 2009 12:43PM

Re: Nginx Drupal Rewrite

Igor Sysoev May 20, 2009 01:21PM

Re: Nginx Drupal Rewrite

mike May 20, 2009 02:57PM

RE: Nginx Drupal Rewrite

Hendry Lee May 20, 2009 01:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready