在docker中使用nginx代理和wordpress

在docker中使用nginx代理和wordpress,wordpress,docker,nginx,proxy,docker-compose,Wordpress,Docker,Nginx,Proxy,Docker Compose,我尝试使用上面的nginx代理托管一些wordpress: 这是我的docker compose.yml proxy: image: jwilder/nginx-proxy:0.4.0 ports: - "80:80" - "443:443" volumes: - /var/run/docker.sock:/tmp/docker.sock:ro # SSL Certificates - /etc/letsencr

我尝试使用上面的nginx代理托管一些wordpress: 这是我的
docker compose.yml

proxy:
    image: jwilder/nginx-proxy:0.4.0
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      # SSL Certificates
      - /etc/letsencrypt/live/mysupersite.com/cert.pem:/etc/nginx/certs/site.com.crt:ro
      - /etc/letsencrypt/live/mysupersite.com/privkey.pem:/etc/nginx/certs/site.com.key:ro

  wordpress:
    image: wordpress:4.8.1-php5.6-apache
    expose:
      - 80
    volumes:
      - /var/www/html:/var/www/html
    restart: always
    environment:
      - WORDPRESS_DB_HOST=mysql
      - WORDPRESS_DB_USER=dev
      - WORDPRESS_DB_PASSWORD=passwd
      - WORDPRESS_DB_NAME=db
      - VIRTUAL_HOST=mysupersite.com,www.mysupersite.com
一切似乎都开始得很好。我有两个流动容器。 但我无法访问
https://mysupersite.com
在我的浏览器中。 我错过了什么?我需要额外的配置吗

我在浏览器中看到此错误:

The page isn’t redirecting properly
输出o
cur-L-vhttps://www.mysupersite.com
如下所示:

* Connection #0 to host www.mysupersite.com left intact
* Issue another request to this URL: 'https://www.mysupersite.com/'
* Found bundle for host www.mysupersite.com: xx [can pipeline]
* Re-using existing connection! (#0) with host www.mysupersite.com
* Connected to www.mysupersite.com (IP) port 443 (#0)
> GET / HTTP/1.1
> Host: www.mysupersite.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.9.12
< Date: Tue, 22 Aug 2017 07:33:22 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 0
< Connection: keep-alive
< X-Powered-By: PHP/5.6.31
< Set-Cookie: PHPSESSID=xxx; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< X-Pingback: http://www.mysupersite.com/xmlrpc.php
< Location: https://www.mysupersite.com/
< Strict-Transport-Security: max-age=31536000
<
* Connection #0 to host www.mysupersite.com left intact
* Issue another request to this URL: 'https://www.mysupersite.com/'
* Found bundle for host www.mysupersite.com: xxxx [can pipeline]
* Re-using existing connection! (#0) with host www.mysupersite.com
* Connected to www.mysupersite.com (IP) port 443 (#0)
> GET / HTTP/1.1
> Host: www.mysupersite.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.9.12
< Date: Tue, 22 Aug 2017 07:33:23 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 0
< Connection: keep-alive
< X-Powered-By: PHP/5.6.31
< Set-Cookie: PHPSESSID=xxxx; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< X-Pingback: http://www.mysupersite.com/xmlrpc.php
< Location: https://www.mysupersite.com/
< Strict-Transport-Security: max-age=31536000
<
* Connection #0 to host www.mysupersite.com left intact
* Maximum (50) redirects followed
curl: (47) Maximum (50) redirects followed
*与www.mysupersite.com主机的连接保持不变
*向此URL发出另一个请求:'https://www.mysupersite.com/'
*找到主机www.mysupersite.com的捆绑包:xx[can管道]
*重新使用现有连接!(#0)主机www.mysupersite.com
*已连接到www.mysupersite.com(IP)端口443(#0)
>GET/HTTP/1.1
>主持人:www.mysupersite.com
>用户代理:curl/7.54.0
>接受:*/*
>
GET/HTTP/1.1
>主持人:www.mysupersite.com
>用户代理:curl/7.54.0
>接受:*/*
>
您不应该使用'ports:-“80:80”-“443:443”`我已经编辑过了。我也试过了。我还添加了www.mysupersite。ocm@TarunLalwani它的重定向很好,所以当我在:80访问时,它将转到443,它是SSL https,但该站点没有显示。“重定向”错误。请执行
curl-v-Lhttps://www.mysupersite.ocm
并将日志发布到您的question@TarunLalwani我会做的:我会看到一个“curl-v-Lhttps://www.mysupersite.ocm并将日志发布到您的question@TarunLalwani我会做的:我会看到一个“