weixin_39900676
weixin_39900676
2020-11-30 01:04

服务都能正常启动,https就是无法访问

1、default.conf server { listen 443 ssl; server_name xxxx.9win.shop; root /usr/share/nginx/html; client_max_body_size 100M;

ssl_certificate /certs/2264826__9win.shop.pem;
ssl_certificate_key /certs/2264826__9win.shop.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

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://contact-center:8035; 
}

location /socket.io { proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_pass http://contact-center:8036; 
}

} 2、修改 .env 设置 CC_SOCKET_PORT=443,然后重启项目; 3、docker都正常启动 8A$PYT4 I TP%L}GEI1HR_X

该提问来源于开源项目:chatopera/cosin

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

11条回答

  • weixin_39636691 weixin_39636691 5月前

    不行,会报端口冲突的错误。nginx 和contact-center不能同时起了。

    root:/home/service/cosin# docker-compose up -d Creating network "cskefu_default" with the default driver Creating cskefu_mysql_1 ... done Creating cskefu_elasticsearch_1 ... done Creating cskefu_activemq_1 ... done Creating cskefu_redis_1 ... done Creating cskefu_contact-center_1 ... done Creating cskefu_nginx_1 ... error

    ERROR: for cskefu_nginx_1 Cannot start service nginx: driver failed programming external connectivity on endpoint cskefu_nginx_1 (25c8c85c2e54941de4d18604bb8df1230d95e676702ad1d2a898245dc7b30e0b): Bind for 0.0.0.0:443 failed: port is already allocated

    ERROR: for nginx Cannot start service nginx: driver failed programming external connectivity on endpoint cskefu_nginx_1 (25c8c85c2e54941de4d18604bb8df1230d95e676702ad1d2a898245dc7b30e0b): Bind for 0.0.0.0:443 failed: port is already allocated ERROR: Encountered errors while bringing up the project.

    点赞 评论 复制链接分享
  • weixin_39640085 weixin_39640085 5月前

    嗯,这里我们发布的docker-compose.yml内容有问题,我稍后更新一下。 感谢反馈!

    点赞 评论 复制链接分享
  • weixin_39640085 weixin_39640085 5月前

    配置文件的问题,我们会更新,您先做如下调整试试!

    https://github.com/chatopera/cosin/blob/bd0c322450b98049d3b0fb028a3354014fecee8c/docker-compose.yml#L19-L21

    改为

    
    ports:
          - "${CC_WEB_PORT:-8035}:8035"
          - "8036:8036"
    
    点赞 评论 复制链接分享
  • weixin_39640085 weixin_39640085 5月前

    duplicated with #234

    点赞 评论 复制链接分享
  • weixin_39640085 weixin_39640085 5月前

    在最新的代码中已经修改了docker-compose.yml配置。

    点赞 评论 复制链接分享
  • weixin_39900676 weixin_39900676 5月前

    3 F)~ A{71AT_5SF3N6$AW4

    点赞 评论 复制链接分享
  • weixin_39900676 weixin_39900676 5月前

    是CC_SOCKET_PORT设置成443没生效吗?

    点赞 评论 复制链接分享
  • weixin_39738152 weixin_39738152 5月前

    从log上看,是未生效 docker-compose down docker-compose up -d 再试试

    点赞 评论 复制链接分享
  • weixin_39900676 weixin_39900676 5月前

    我刚才改了https的配置后能正常访问了,但是访客端的webSocket报错 JV8P4OS5MT97AH

    点赞 评论 复制链接分享
  • weixin_39738152 weixin_39738152 5月前

    CC_SOCKET_PORT 未配置

    点赞 评论 复制链接分享
  • weixin_39640085 weixin_39640085 5月前

    配置HTTPS需要详细阅读文档。 https://github.com/chatopera/cosin/wiki/%E7%A7%81%E6%9C%89%E9%83%A8%E7%BD%B2%E9%85%8D%E7%BD%AEHTTPS

    点赞 评论 复制链接分享

相关推荐