nginx configuration reverse generation problem
ringa_lee
ringa_lee 2017-05-16 17:22:19
0
1
612

Can I use simple nginx syntax to set up proxies in different directories?
For example

server
{
	listen 80;
	server_name xxx.com;
	location /baidu {
		proxy_redirect off;
		proxy_set_header Accept-Encoding "";
		proxy_set_header Host "baidu.com";
		proxy_set_header X-Real-IP $remote_addr;
		proxy_pass http://baidu.com;
}

Visit xxx.com/baidu and the agent will be baidu.com

Can we use set to access xxx.com/abc and the proxy is abc.com? Will it automatically proxy different websites according to different directories?
How to achieve it?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
刘奇

Can you describe it in detail? . . I don't quite understand what your needs are. . If you want to proxy different websites based on different directories. . . It is not good to use nginx proxy. . . You can write routing in your program. . . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template