Nginx的https反向代理配置

 每日运维   2021-03-20 15:39   90 人阅读  0 条评论

先配置http,然后把443代理到80

server {
        listen 443;
        server_name xjdxmobilxcx.abc.com; #前端访问地址
        ssl on;
        ssl_certificate /etc/ssl/crt/server.cer; #域名https证书文件
        ssl_certificate_key /etc/ssl/crt/server.key; #域名https证书文件
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE"
        ssl_prefer_server_ciphers on;

        location / {
        proxy_pass http://mobilepg.xjkork.tv:57815/; #后端代理地址
        proxy_redirect  off;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        }
}


本文地址:https://linux365.cn/post/59.html
版权声明:本文为原创文章,版权归 每日运维 所有,欢迎分享本文,转载请保留出处!

评论已关闭!