I'm creating a web app using node/express and I want to test it locally as a vhost using both http and https. currently my express app listening and works fine on both http and https through ports 3080 and 3443 (eg: http://localhst:3080 and https://localhost:3443).
Then I created vhost through apache using following code:
<VirtualHost *:80>
ServerName mynodedomain.com
ServerAlias www.mynodedomain.com
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://localhost:3080/
ProxyPassReverse http://localhost:3080/
</Location>
DocumentRoot "/Library/WebServer/Documents/mynodedomain.com/webapp/public"
ErrorLog "/private/var/log/apache2/mynodedomain.com-error_log"
CustomLog "/private/var/log/apache2/mynodedomain.com-access_log" common
</VirtualHost>
it works fine and I can access express app via http://mynodedomain.com. what I want to do is I should be able to access the site via https://mynodedomain.com and it should be forward to http://localhost:3443/. I tried it following way
<VirtualHost *:443>
ServerName mynodedomain.com
ServerAlias www.mynodedomain.com
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass https://localhost:3443/
ProxyPassReverse https://localhost:3443/
</Location>
DocumentRoot "/Library/WebServer/Documents/mynodedomain.com/webapp/public"
ErrorLog "/private/var/log/apache2/mynodedomain.com-error_log"
CustomLog "/private/var/log/apache2/mynodedomain.com-access_log" common
</VirtualHost>
but It doesn't work. can you show me a correct way to do this? thank you