Now we need to design an external gateway server to act as an agent for many other services within the company.
The method currently used is nginx reverse proxy.
The code in Nginx.conf is as follows
location ^~ /services/ {
...
proxy_pass 真实uri
...
}
Problems may occur when the html code of a certain service contains resource access or jump to an absolute directory.
For example, you want to proxy the abc website 10.10.10.10/
The html of this website contains access to the /static/a.jpg resource.
When a user accesses my gateway server, the methods called are
Get www.xxx.com/services/abc
Get www.xxx.com/static/a.jpg. At this time, get fail.
The existing temporary solution is to add a proxy for the absolute directory of the abc website in nginx.conf, as follows
location /static/ {
proxy_pass http://10.10.10.10/static/;
}
But if there are too many services, there will be conflicts.
How to solve the problem?
Thank you for browsing.
Why not configure several subdomains abc.xxx.com