apache to nginx rewrite rule

Igor Sysoev igor at sysoev.ru
Wed Dec 29 22:59:52 MSK 2010


On Wed, Dec 29, 2010 at 02:56:10PM -0500, Ilan Berkner wrote:

> that worked, thanks

You do not need "break".

 location /youtube {
    rewrite ^/youtube/(.*)$ http://wwww.youtube.com/$1;
 }

This is enough.

> On Wed, Dec 29, 2010 at 12:15 PM, António P. P. Almeida <appa at perusio.net>wrote:
> 
> > On 29 Dez 2010 17h04 WET, iberkner at gmail.com wrote:
> >
> > > Thanks, but no, I'm not confusing location with host name.
> > >
> > > I'm trying to redirect any requests on our domain as follows:
> > >
> > >
> > https://www.ourdomain.com/youtube/v/mydjFYoD4WS&hl=en_US&fs=1&rel=0&autoplay=1
> > >
> > > to:
> > >
> > > http://www.youtube.com/v/mydjFYoD4WS&hl=en_US&fs=1&rel=0&autoplay=1
> > >
> > > This is to solve a SSL warning issue.  We're already doing it on
> > > another site using the .htaccess rule I provided.
> > >
> > > See: http://www.adammershon.com/display-youtube-videos-on-ssl-page/
> >
> > Try this:
> >
> > location /youtube {
> >  rewrite ^/youtube/(.*)$ http://wwww.youtube.com/$1 break;
> > }
> >
> > --- appa
> >
> >
> > _______________________________________________
> > nginx mailing list
> > nginx at nginx.org
> > http://nginx.org/mailman/listinfo/nginx
> >

> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx


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



More information about the nginx mailing list