visit https://www.oyohyee.com/admin]
will be redirected to [ http://www.oyohyee.com,www.oy.]
use curl-IL https://www.oyohyee.com/admin
to get the following information
HTTP/1.1 301 MOVED PERMANENTLY
Server: nginx/1.12.2
Date: Thu, 12 Apr 2018 00:45:21 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 297
Connection: keep-alive
Location: http://www.oyohyee.com,www.oyohyee.com/admin/
(here is the jump made by nginx, and the link after the jump is http protocol)
preliminary judgment is nginx"s problem, but I don"t know how to solve it, and I wonder why there is this jump
I want to be able to jump to [ https://www.oyohyee.com/admin/]
according to the flask rules. < hr >related information is as follows:
centos + nginx + gunicorn + flask
flask routing function
server {
listen 80;
server_name www.oyohyee.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl http2 default_server;
server_name www.oyohyee.com;
ssl_certificate "/etc/nginx/ssl/1_www.oyohyee.com_bundle.crt";
ssl_certificate_key "/etc/nginx/ssl/2_www.oyohyee.com.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location ^~ / {
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header Host $http_host;
}
location ^~ /static/ {
root /data/OBlog/OBlog/front/;
}
}