Reference: Blog
Reference: HTTP Status Code Interpretation
Nginx-rewrite Way
Nginx Server Configuration
server { listen ; server_name www.test.com test.com; ^ (. *) $ https://$host $ permanent; } server { listen 443 SSL; server_name www.ourdax.com; Ssl_certificate /usr/local/openresty/nginx/conf/ssl/Test.pem; Ssl_certificate_key /usr/local/openresty/nginx/conf/ssl/test.key; /usr/local/openresty/nginx/html; Index index.html; / { } }
Nginx-Status Code 497
About Nginx Status Code 497
497-normal request was sent to HTTPS
When this virtual site only allows HTTPS access, Nginx will report a 497 error code when accessed with HTTP
Realize Jump thinking
Use the error_page command to redirect the link of the 497 status code to the specified URL
Nginx Server Configuration
server { listen 443 SSL; Listen ; server_name www.test.com; Ssl_certificate /usr/local/openresty/nginx/conf/ssl/Test.pem; Ssl_certificate_key /usr/local/openresty/nginx/conf/ssl/test.key; /usr/local/openresty/nginx/html; Index index.html; / { } 497 https://$host $uri? $args;
Summarize
About the original blog in the HTML in the way of the refresh to do the jump way I do not very much agree, or to the Web server to handle these things better.
Nginx:http Jump HTTPS