Welcome! Log In Create A New Profile

Advanced

Re: Reverse Proxy with caching

October 30, 2009 07:08AM
infestdead Wrote:
-------------------------------------------------------
> Igor Sysoev Wrote:
> --------------------------------------------------
> >
> > location ~ \.php$ {
> > proxy_pass http://backend;
> > }
> >
>
> When I try using proxy_pass within location ~
> something I get :
> : "proxy_pass" may not have URI part in location
> given by regular expression, or inside named
> location, or inside the "if" statement, or inside
> the "limit_except" block in
> /etc/nginx/nginx.conf:52
>
> the line is proxy_pass http://127.0.0.1:8080/;
>
> Do you have an idea what the problem might be?
>
> Thanks,
> Ivo
>

Hm I found out what the problem was,
You cant have proxy_pass http://ip:port if you have a regexp in the location directive, if you do - you need to define upstream first :
upstream php_server {
server http://ip:port/;
}
and then
proxy_pass http://php_server;

That did it for me.
Cheers,
Ivo
Subject Author Posted

Reverse Proxy with caching

Smrchy October 15, 2009 09:24AM

Re: Reverse Proxy with caching

任晓磊 October 15, 2009 09:46AM

Re: Reverse Proxy with caching

Igor Sysoev October 15, 2009 10:28AM

Re: Reverse Proxy with caching

Johan Bergström October 15, 2009 10:46AM

Re: Reverse Proxy with caching

Smrchy October 15, 2009 11:42AM

Re: Reverse Proxy with caching

infestdead October 30, 2009 06:59AM

Re: Reverse Proxy with caching

infestdead October 30, 2009 07:08AM

Re: Reverse Proxy with caching

Igor Sysoev October 30, 2009 07:16AM

Re: Reverse Proxy with caching

ridres83 October 16, 2009 01:20PM

Re: Reverse Proxy with caching

avery October 19, 2009 06:06PM

Re: Reverse Proxy with caching

Maxim Dounin October 19, 2009 06:58PM

Re: Reverse Proxy with caching

Rafa Pedroche April 27, 2010 06:40PM

Re: Reverse Proxy with caching

Rafa Pedroche April 28, 2010 03:16AM

Re: Reverse Proxy with caching

nfn October 22, 2009 01:26PM

Re: Reverse Proxy with caching

avery October 22, 2009 04:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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