使用搜尋

使用搜尋

如何配置兩個位址來存取其他前端/不同端口,例如:

地址 映射到
www.mysite.com/config (nodejs)本地主機:3000
www.mysite.com/client (django) 本地主機:7000

答案1

使用搜尋

在範例中避免過度消耗大腦的解決方案

阿帕契

<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;
}

相關內容