Requests to ~/apis/ are proxied to http://www.b.com/. For example,
www.a.com/apis/login => www.b.com/login
server { listen 80; server_name www.a.com; access_log logs/test.access.log; Location ^~ /apis/ {proxy_pass http://www.b.com/; /} location / {root HTML /a; index index.html index.htm; } # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }}Copy the code