Welcome! Log In Create A New Profile

Advanced

Re: rewrite + proxy pass = 404

Igor Sysoev
February 08, 2010 07:26AM
On Mon, Feb 08, 2010 at 06:34:54AM -0500, softshape wrote:

> Всем привет,
>
> стоит задача сделать проксик для запросов к Гуглу через Javascript/AJAX. Иначе говоря, запросы вида
>
> http://www.server.ru/r/google/search?hl=en&q=word
>
> - nginx должен проксировать в
>
> http://www.google.com/search?hl=en&q=word
>
> Для этого в конфиге пишем -
>
> location /r/google {
> rewrite ^/r/google(.*)$ $1;
> proxy_pass http://www.google.com;
> }
>
> Но вместо гуглового контента на http://www.server.ru/r/google/search?hl=en&q=word мы получаем 404 Not Found
> nginx/0.8.17.
>
> Что сделано не так ???

rewrite не нужен.

location /r/google/ {
proxy_pass http://www.google.com/;
}


--
Игорь Сысоев
http://sysoev.ru

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

Re: rewrite + proxy pass = 404

Igor Sysoev February 08, 2010 07:26AM

Re: rewrite + proxy pass = 404

softshape February 09, 2010 01:44AM

Re: rewrite + proxy pass = 404

Igor Sysoev February 09, 2010 02:56AM

Re: rewrite + proxy pass = 404

softshape February 09, 2010 03:28AM

Re: rewrite + proxy pass = 404

softshape February 09, 2010 03:41AM

Re: rewrite + proxy pass = 404

Boris Dolgov February 09, 2010 03:32AM

Re: rewrite + proxy pass = 404

Igor Sysoev February 09, 2010 03:46AM

Re: rewrite + proxy pass = 404

Igor Sysoev February 09, 2010 03:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 56
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready