apache路由端口配置
<VirtualHost *:80>
ServerName a.com
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://127.0.0.1:8003/
ProxyPassReverse / http://127.0.0.1:8003/
</VirtualHost>
<VirtualHost *:80>
ServerName b.com
ServerAlias
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://127.0.0.1:8005/
ProxyPassReverse / http://127.0.0.1:8005/
</VirtualHost>
<VirtualHost *:80>
ServerName c.com
DocumentRoot /data/cdn/
</VirtualHost>
<Directory "/data/cdn/">
Options +Includes -Indexes
AllowOverride All
Order Deny,Allow
Allow from All
Require all granted
</Directory>
相同端口
<VirtualHost *:80>
ServerName 1.abc.com
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://127.0.0.1:8003/
ProxyPassReverse / http://127.0.0.1:8003/
CustomLog "| /usr/sbin/rotatelogs var/log/httpd/x_access_log.%Y_%m_%d.log 86400 480" combined
ErrorLog "| /usr/sbin/rotatelogs /var/log/httpd/x_error_log_%Y%m%d.log 86400 480"
</VirtualHost>
<VirtualHost *:80>
ServerName 2.abc.com
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://127.0.0.1:8003/
ProxyPassReverse / http://127.0.0.1:8003/
</VirtualHost>
<VirtualHost *:80>
ServerName 3.abc.com
ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://127.0.0.1:8003/
ProxyPassReverse / http://127.0.0.1:8003/
</VirtualHost>