鍍金池/ 問(wèn)答/C++  Linux/ nginx 如何配置一個(gè)http://xxxxx/a 反向代理到服務(wù)器的http

nginx 如何配置一個(gè)http://xxxxx/a 反向代理到服務(wù)器的http://xxxx/b服務(wù)

1.nginx如何配置 用戶(hù)訪(fǎng)問(wèn)http://xxx/a nginx 方向代理到服務(wù)器中的 http://locaohost:8088/b的服務(wù)?
現(xiàn)在訪(fǎng)問(wèn)后,訪(fǎng)問(wèn)的url編程了xxxx/b 沒(méi)有實(shí)現(xiàn)內(nèi)網(wǎng)轉(zhuǎn)發(fā)。
應(yīng)該怎么配置?。?/p>

2.
server {

listen       80;
server_name  xxxx;
location /a{
    proxy_pass http://localhost:8088/b/;
    proxy_redirect   off;
    proxy_set_header  Host $host:$server_port;
    proxy_set_header  X-Real-IP $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Scheme $scheme;
 }

}

回答
編輯回答
久舊酒
location /a/{
    proxy_pass http://localhost:8088/b/;
}
2017年10月17日 15:29