以docker方式运行wordPress, nginx 怎样配置才能https转发到wordPress?

哎呦-又忘了 发布于 2020/07/27 10:43
阅读 1K+
收藏 0

在主机 192.168.10.3上运行WordPress:  docker run --name wordpress -p 81:80 -d wordpress

在主机 192.168.10.5配置Nginx转发 http 可以正常转发,https 访问跳内网ip。。。

 

server {
    listen 80;
    server_name  xxx.com;
    location / {
        proxy_set_header HOST $host;
        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 $scheme;
        proxy_pass  http://192.168.10.3:81;
    }
}
server {
    listen       443 ssl;
    server_name  xxx.com;
    ssl_certificate 3147007.pem;
    ssl_certificate_key 3147007.key;
    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers  on;
    location / {
        proxy_set_header HOST $host;
        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 $scheme;
        proxy_pass  http://192.168.10.3:81;
    }
}

 

加载中
0
polly
polly

配置看起来没毛病,除了什么错?贴一下

0
大盘
大盘

配置没啥问题吧,可以参考这个  https://aqzt.com/6645.html

 

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部