I need to define rule (using mod_rewrite
i think) to map any port to portnumber.domain.com
. How to do that in Apache2 ? Now i have one config for each port number like below.
# 9003.domain.com
<VirtualHost *:80>
ServerName 9003.domain.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9003/
ProxyPassReverse / http://127.0.0.1:9003/
</VirtualHost>
# 9004.domain.com
<VirtualHost *:80>
ServerName 9004.domain.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9004/
ProxyPassReverse / http://127.0.0.1:9004/
</VirtualHost>
# and so on....