Welcome! Log In Create A New Profile

Advanced

Re: proxy

Francis Daly
December 30, 2015 12:32PM
On Wed, Dec 30, 2015 at 02:50:24PM +0800, 天河石 - 谢金鹏 wrote:

Hi there,

> In my local machine browser, I want to open http://localhost/abc to proxy a real http://www.abc.com/ as well as proxying all child resources such as
>
>
> http://localhost/abc/bcd/a.html to proxy http://www.abc.com/bcd/a.html
> http://localhost/abc/bc.html to proxy http://www.abc.com/bc.html
> ...
>
>
> How do I perform it?

proxy_pass (http://nginx.org/r/proxy_pass).

You should reverse-proxy to a server that you control.

Making things work where the url hierarchies differ -- /abc/ in nginx
being the same as / in the upstream server -- can be difficult. But
sometimes it works.

==
location ^~ /abc/ {
proxy_pass http://www.abc.com/;
}
==

and then try accessing http://localhost/abc/bc.html and see what you
get back.

f
--
Francis Daly francis@daoine.org

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

proxy

天河石 - 谢金鹏 December 30, 2015 01:52AM

Re: proxy

Francis Daly December 30, 2015 12:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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