我给blog.sugarbeet.cn域名申请了ssl,blog.sugarbeet.cn对应的是8090端口,但是配置完nginx.conf后还是只能通过http访问的到,如果使用https的话就到了nginx的基础页面了。
大哥们看看该怎么配置
` server {
listen 443 ssl;
server_name blog.sugarbeet.cn;
ssl_certificate /usr/local/nginx/cert/server.crt;
ssl_certificate_key /usr/local/nginx/cert/server.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
#if ($scheme = http) {
# return 301 https://$host$request_uri;
#}
# location / {
# root html;
# index index.html index.htm;
# }
}
server {
listen 80;
server_name blog.sugarbeet.cn;
location / {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8090/;
}
}
`