国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

How to deal with absolute directories in Nginx reverse proxy?
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-06-16 09:19:40
0
1
1089

Scene requirements

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 真實(shí)uri
    ...
}

Problems encountered

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.

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級(jí)PHP講師

reply all(1)
Ty80

Why not configure several subdomains abc.xxx.com

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