Welcome! Log In Create A New Profile

Advanced

RE: How to rewrite these

Glen Lumanau
February 20, 2010 11:36AM
Bump..

-----Original Message-----
From: Glen Lumanau [mailto:glen@lumanau.web.id]
Sent: 19 Februari 2010 18:42
To: 'nginx@nginx.org'
Subject: RE: How to rewrite these

OK thank's for ur suggestion.. It's working like a charm.. 1 more question

I have a url http://www.mydomain.com/news/$id/title

How can I redirect it to http://app.mydomain.com/redirect/application/$id ?

-----Original Message-----
From: Igor Sysoev [mailto:igor@sysoev.ru]
Sent: 19 Februari 2010 17:25
To: nginx@nginx.org
Subject: Re: How to rewrite these

On Fri, Feb 19, 2010 at 05:20:20PM +0700, Glen Lumanau wrote:

> Is that posibble to use somethink like
>
> location ~ ^/breaking-news|national|...) {
> rewrite ^ /category$request_uri

- rewrite ^ /category$request_uri;
+ rewrite ^ /category$uri;

> }
>
> ?

Possible, but why to use rewrite, if you may pass request directly where
you want ? In my opinion rewrites cause spaghetti configuration.

> -----Original Message-----
> From: Igor Sysoev [mailto:igor@sysoev.ru]
> Sent: 19 Februari 2010 17:16
> To: nginx@nginx.org
> Subject: Re: How to rewrite these
>
> On Fri, Feb 19, 2010 at 05:11:14PM +0700, Glen Lumanau wrote:
>
> > Example
> >
> > Old : http://www.mydomain.com/breaking-news
> > New : http://www.mydomain.com/category/breaking-news
> >
> > Old : http://www.mydomain.com/national
> > New : http://www.mydomain.com/category/national
> >
> > Old : http://www.mydomain.com/international
> > New : http://www.mydomain.com/category/international
> >
> > I'm using php-fpm for these
>
> Something like this:
>
> location ~ ^/breaking-news|national|...) {
> fastcgi_pass ...
> fastcgi_parm SCRIPT_FILENAME /path/to/scripts/category$uri;
> ...
> }
>
> > -----Original Message-----
> > From: Igor Sysoev [mailto:igor@sysoev.ru]
> > Sent: 19 Februari 2010 17:06
> > To: nginx@nginx.org
> > Subject: Re: How to rewrite these
> >
> > On Fri, Feb 19, 2010 at 05:02:44PM +0700, Glen Lumanau wrote:
> >
> > > No i'm not proxying..
> >
> > What do you use ?
> >
> > > Because all I need is to rewrite arround 50 that category
> >
> > Could you show some examples ?
> >
> > > -----Original Message-----
> > > From: Igor Sysoev [mailto:igor@sysoev.ru]
> > > Sent: 19 Februari 2010 16:10
> > > To: nginx@nginx.org
> > > Subject: Re: How to rewrite these
> > >
> > > On Fri, Feb 19, 2010 at 03:11:09PM +0700, Glen Lumanau wrote:
> > >
> > > > Hi Nginx,
> > > >
> > > > I'm migrating my website into onother application. I need to rewrite
> > some
> > > of
> > > > these
> > > >
> > > > http://www.mydomain.com/category/subcategory
> > > >
> > > > into
> > > >
> > > > http://www.mydomain.com/
> > > > http://www.mydomain.com/application/category/subcategory
> > > >
> > > > I need to insert /application before my category name
> > >
> > > If you use proxying, then:
> > >
> > > location / {
> > > proxy_pass http://backend/application/;
> > > }
> > >
> > >
> > > --
> > > Igor Sysoev
> > > http://sysoev.ru/en/
> > >
> > > _______________________________________________
> > > nginx mailing list
> > > nginx@nginx.org
> > > http://nginx.org/mailman/listinfo/nginx
> > >
> > >
> > > _______________________________________________
> > > nginx mailing list
> > > nginx@nginx.org
> > > http://nginx.org/mailman/listinfo/nginx
> >
> > --
> > Igor Sysoev
> > http://sysoev.ru/en/
> >
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://nginx.org/mailman/listinfo/nginx
> >
> >
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://nginx.org/mailman/listinfo/nginx
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx

--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

edogawaconan February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

edogawaconan February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

replay February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Benjamin Pineau February 20, 2010 11:36AM

Re: How to rewrite these

replay February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Benjamin Pineau February 20, 2010 12:04PM

Re: How to rewrite these

replay February 20, 2010 12:04PM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

RE: How to rewrite these

Glen Lumanau February 20, 2010 11:36AM

Re: How to rewrite these

Igor Sysoev February 20, 2010 11:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 153
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