Nginx multiple domain names, HTTPS redirect to HTTP

Source: Internet
Author: User
Tags ssl certificate

Background description: Nginx binding multiple domain names, one of which is configured with HTTPS, such as domain name a:https://www.aaa.com, and the other domain B (http://www.bbb.com) does not have an SSL certificate configured.

Problem: When accessing the B domain https://www.bbb.com by HTTPS, the default jump to a domain name: https://www.aaa.com

Solution 1: Configure the configuration file in the B site 443 port monitoring, the results will jump to the Nginx welcome page;

server {

Listen *:443 SSL;

server_name www.bbb.com;

Ssl_certificate SERVER_SHA2.CRT;

Ssl_certificate_key Server.key;

}

Workaround 2: Replace the Nginx default page and personalize the display. adjourned

StackOverflow Solution:

Http://stackoverflow.com/questions/3470290/nginx-redirect-https-to-http

Nginx multiple domain names, HTTPS redirect to 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.