Py学习  »  NGINX

运行wordpress的nginx服务器上的https

Gaurav Kumar • 5 年前 • 413 次点击  

我试图在基于nginx服务器的站点上实现https,现在即使使用下面的配置,它也只打开http站点 我的nginx服务器配置如下

server {        
        listen 443 ssl http2;
        ssl_certificate     /etc/letsencrypt/live/mydomain.in/fullchain.pem;
        ssl_certificate_key     /etc/letsencrypt/live/mydomain.in/privkey.pem;
        server_name mydomain.in www.mydomain.in;
        rewrite ^(.*) http://$server_name$1 permanent;
}
server {


    server_name mydomain.in  www.mydomain.in;


    access_log /var/log/nginx/mydomain.in.access.log rt_cache_redis;
    error_log /var/log/nginx/mydomain.in.error.log;


    root /var/www/mydomain.in/htdocs;



    index index.php index.html index.htm;


    include  common/redis-php7.conf; 

    include common/wpcommon-php7.conf;
    include common/locations-php7.conf;
    include /var/www/mydomain.in/conf/nginx/*.conf;
}

服务器不提供https请求,即即使我在浏览器中专门设置了https,它仍然会将我带回http站点。我无法诊断是nginx还是wordpress哪一个有问题?

注意:流量是通过CloudFlare DNS路由的,证书是 在cloudflare中关闭,这样它就不会干扰。我对nginx比较陌生

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/47268
 
413 次点击  
文章 [ 1 ]  |  最新文章 5 年前