Welcome! Log In Create A New Profile

Advanced

trying to get something like proxypassreverse going.

Tim Uckun
August 19, 2010 05:02AM
Hey all.

I am trying to get proxy a certain path in my domain to a different
back end than the "normal" paths. So far I have done this. I got all
this information from various sites on the web and it almost works.


proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
client_header_buffer_size 64k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 32 16k;
proxy_busy_buffers_size 64k;

proxy_pass_header Set-Cookie;
proxy_pass_header P3P;




server {
listen 80;
server_name my.server.com;
location / {
proxy_pass http://localhost:3001;
}
location /foo/ {
proxy_pass http://localhost:3000/;
}
}


This works except that some sort of a rewrite rule is required because
the links form that back end are broken. For example when the backend
links to /images/blah or /stylesheets/blah the browser thinks the
images and the stylesheets come from the / root.

I would like the proxy to somehow rewrite those links to be
/foo/images/blah and /foo/stylesheets/blah.

I saw this link.. http://wiki.nginx.org/NginxLikeApache but that does
not work at all.

Any help would be much appreciated.

Thanks in advance.

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

trying to get something like proxypassreverse going.

Tim Uckun August 19, 2010 05:02AM

Re: trying to get something like proxypassreverse going.

timuckun August 21, 2010 02:45AM

Re: trying to get something like proxypassreverse going.

Francis Daly August 21, 2010 11:48AM

Re: trying to get something like proxypassreverse going.

timuckun August 21, 2010 09:00PM

Re: trying to get something like proxypassreverse going.

Francis Daly August 21, 2010 11:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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