Load Balancing (SLB) - HTTPS access configuration settings

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/Dream_Weave/article/details/100586989

Environment: The cloud is Ali ECS SLB configure two virtual hosts.

Initially directly Tomcat configuration on both web hosting HTTPS requests, access alone is not a problem, then ECS will hang next to SLB, SLB to configure the HTTPS listener, the result will be access problems often: page is not working properly, you will re too many times orientation.

By contact customer service, because I will SLB and ECS are equipped with HTTPS , cause this phenomenon.

SLB disposed on HTTPS, the need to configure the back-end server, and SLB into the ECS is forwarded via HTTP, then provided on the back-end server HTTP to HTTPS forced jump occurs: HTTPS => HTTP => HTTPS => HTTP ......, so jump on the cycle.

After the ECS by the HTTPS removed, the results appeared project resource files can not be loaded, resulting in incomplete page style mess, requests go wrong.

The reason is that the program calls for the domain name is HTTP, cause this phenomenon.

Solution: increase in head in calling page <meta http-equiv = "Content-Security-Policy" content = "upgrade-insecure-requests">, the HTTP call changed to HTTPS.

 Note: The request path port number if required.


Precautions

  1. Adding HTTPS listener, a total of two ports, the first one is listening port, the second is the server port.
  2. HTTPS listener "healthy" closed because there are BUG.
  3. HTTPS configuration, Nginx server and Ali cloud SLB (recommended) requires only a configuration, all configuration will be problems.
  4. 443 port is not configured in server security group, but there SLB opened also possible.
  5. Online said close "ssl on", which was pheasant operation, a temporary solution (not recommended).

Ali cloud SLB configuration HTTPS

Ali Cloud

Nginx

server {
 listen 80;
 server_name 127.0.0.1;
 root /usr/web;

 location /abc {
  index index.html;
  try_files $uri $uri/  /abc/index.html;
 }

 location /Service {
   proxy_pass http://xxx.xxx.xxx.xxx:xxxx/Service;
 }
}

Attached

Nginx / Tengine server install an SSL certificate: https://help.aliyun.com/knowledge_detail/95491.html

Guess you like

Origin blog.csdn.net/Dream_Weave/article/details/100586989