I have a VPS with single IP. The VPS should serve 3 websites. Site1 - www.domain.com via WordPress. Site2 - sub.domain.com via WordPress. Site3 - anothersub.domain.com via NodeJS inside of a Docker container that listens on port 81. Site1 and Site2 are pretty straight forward, just need to set up virtual hosts. But, how do I set up Apache for Site3? Could you provide an example or correct syntax, please?
1
votes
1 Answers
1
votes
from apache docs (https://httpd.apache.org/docs/current/vhosts/examples.html#proxy)
<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass "/" "http://192.168.111.2/"
ProxyPassReverse "/" "http://192.168.111.2/"
ServerName hostname.example.com
</VirtualHost>
and for your case :
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass "/" "http://localhost:81/"
ProxyPassReverse "/" "http://localhost:81/"
ServerName hostname.example.com
</VirtualHost>
Good luck!