Apache挂载同一个ip,不同端口服务

在http.conf文件增加配置

 

Listen 8081

Listen 80

 

加入虚拟机配置

 

<VirtualHost *:8081>

    ProxyPreserveHostOn

    ServerName www.test.com

    ProxyPass / http://127.0.0.1:9001/

    ProxyPassReverse / http://127.0.0.1:9001/

    DocumentRoot"/server1/data/attachments"

    RewriteEngineOn

    RewriteRule ^.+\.(mp3|mp4)$ /$0 [L]

    SetEnv force-proxy-request-1.0.1

    SetEnv proxy-nokeepalive 1

</VirtualHost>

 

 

<VirtualHost *:80>

    ProxyPreserveHostOn

    ServerName www.test.com

    ProxyPass / http://127.0.0.1:9000/

    ProxyPassReverse / http://127.0.0.1:9000/

    DocumentRoot"/server2/data/attachments"

 

</VirtualHost>

你可能感兴趣的:(apache)