Apache reverse Proxy implements the cloak to add HTTPS for HTTP

Source: Internet
Author: User

Apache Reverse Proxy

Jintiansheng: Insisting on writing is not an easy thing, in other words, sticking to itself is not an easy thing. If learning has a shortcut, it is to continue to practice, and constantly accumulate. Writing notes, in fact, is to show their own, is to reflect the accumulation of a way to adhere to. Golden days: 15998603918 Welcome to chat with me.

I have developed a set of node. JS Web applications, want to implement the HTTPS protocol, as for node. JS Native Implementation HTTPS Protocol I did not study here.

In fact, the default node. JS Express listens on Port 3000, the HTTP protocol.

What if I want to access the node. js app over HTTPS? Direct use of Apache reverse proxy function.

Configure the Apache configuration file, the author here in apache/conf/extra/httpd-vhosts.conf, add VirtualHost configuration:

<VirtualHost*:443>ServerName www.mydomain.com<Proxy*>Order Deny,allowallow from all</Proxy>sslengine onsslproxyengine onsslproxyverify nonesslproxycheckpeercn offsslproxycheckpeername Offsslcertificatefile "CONF/SSL.CRT/SERVER.CRT" Sslcertificatekeyfile "Conf/ssl.key/server.key" ProxyRequests Offproxypreservehost onproxypass/http://127.0.0.1:3000/proxypassreverse/http://127.0.0.1:3000/</VirtualHost>

This way, https://127.0.0.1 can access the contents of http://127.0.0.1:3000 by restarting the Apache server.

Of course, here is an example, the real production environment, the need to generate their own replacement of the above certificate, domain name, port and other information.

Apache reverse Proxy implements the cloak to add HTTPS for HTTP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.