简体   繁体   中英

How to activate 2 ports 80 & 4000 for a single SSL enabled domain?

I am new to SSL encryptions and need help! (Using cert bot).

I recently activated SSL on a website that runs on apache and linux on port 80. So, the current website looks like:

http://example.com --> https://example.com (done)

However, I have backend running on port 4000 and want to encrypt that as well to avoid "Mixed Content" page error:

http://example.com:4000 --> https://example.com:4000 (Not done yet)

This is exactly what I need and no work around would help. Please guide.

Thanks in advance! :-)

You can create a new subdomain subdomain.example.com and point it to example.com:4000 and then request a new SSL certificate from LetsEncrypt and specify multiple subdomains when requesting a certificate using certbot.

certbot certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net

When you have the certificate and key, add it in your webserver config

Check out the official certbot documentation here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM