I. Background requirements
1, Development colleague Nodejs development project, node Index.js open 9003 service port monitoring service, now need external HTTPS access to the service
2, build apache2 service
1) 80 Port HTTP access, configuration/etc/apache2/sites-enabled/000-default.conf
<virtualhost *: the>proxypreservehost on ServerAdmin [email protected] ServerName deploy-cn.domains.com DocumentRoot/home/guyan/www/watchfaces directoryindex homepage.htm index.htmlLogin. htm proxypass/http://127.0.0.1:9003/Proxypassreverse/http://127.0.0.1:9003/</VirtualHost> <directory"/home/guyan/www/watchfaces">Options Indexes followsymlinks allowoverride None Order allow,deny allow from all</Directory>
2) 443 port HTTPS access, requires configuration 1) 80 port HTTP access, configuration/etc/apache2/sites-enabled/001-ssl.conf
<virtualhost *:443>ServerName Deploy-cn.huami.com<proxy>Order Deny,allowallow from all</proxy>sslengine onsslproxyengine onsslproxyverify nonesslproxycheckpeercn offsslproxycheckpeername Offsslcertificatefile"/ETC/APACHE2/SSL/HUAMI.COM.CRT"Sslcertificatekeyfile"/etc/apache2/ssl/huami.key"proxyrequests offproxypreservehost on Proxypass/http://127.0.0.1:9003/Proxypassreverse/http://127.0.0.1:9003/</virtualhost>
Apache2 Implementing HTTPS Access HTTP service