Apache-2.2

如何配置兩個地址來訪問其他前端/埠

  • July 29, 2021

如何配置兩個地址來訪問其他前端/不同埠,例如:

使用搜尋

在範例中不過度殺傷大腦的解決方案

阿帕奇

<VirtualHost *>
   ServerName www.example.com


   ProxyPass /config http://localname:3000/
   ProxyPassReverse /config http://localname:3000/

   ProxyPass /client http://localname:7000/
   ProxyPassReverse /client http://localname:7000/
</VirtualHost>

Nginx(以防萬一你可能需要它)

location /config {
   proxy_pass              http://127.0.0.1:3000;
   proxy_set_header        Host $http_host;
}
location /client {
   proxy_pass              http://127.0.0.1:7000;
   proxy_set_header        Host $http_host;
}

引用自:https://serverfault.com/questions/1072957