Closed simkepal closed 7 years ago
Hello,
I have 4 servers with docker/dockercloud-haproxy and I want to go to nginx website with https. I'm getting The plain HTTP request was sent to HTTPS port error. Can anyone please help me, what am I doing wrong? I don't know how to fix this.
Thank you!
Here is my stack file:
lb: deployment_strategy: every_node environment: - "DEFAULT_SSL_CERT=-----BEGIN PRIVATE KEY-----\\n bla bla \\n-----END CERTIFICATE-----" image: 'dockercloud/haproxy:latest' links: - web ports: - '80:80' - '443:443' roles: - global web: environment: - FORCE_SSL=yes - 'VIRTUAL_HOST=https://*example.com' - VIRTUAL_HOST_WEIGHT=10 expose: - '443' image: 'username/my-image:latest' volumes: - '/certs:/certs'
Nginx virtual host file:
server { # support http and ipv6 listen 80 default_server; listen [::]:80 default_server ipv6only=on; # support https and ipv6 listen 443 default_server ssl; listen [::]:443 ipv6only=on default_server ssl; ssl_certificate /certs/example.com.crt; ssl_certificate_key /certs/example.key; access_log /var/log/nginx/nginx.vhost.access.log; error_log /var/log/nginx/nginx.vhost.error.log; root /var/www/trg-ang2/dist; index index.html; location /images { try_files $uri /index.html; expires 1w; } location / { add_header 'Access-Control-Allow-Origin' '*'; expires 1w; index index.html; try_files $uri $uri/ /index.html =404; } }
Hello,
I have 4 servers with docker/dockercloud-haproxy and I want to go to nginx website with https. I'm getting The plain HTTP request was sent to HTTPS port error. Can anyone please help me, what am I doing wrong? I don't know how to fix this.
Thank you!
Here is my stack file:
Nginx virtual host file: