0

I have nginx 1.10.1 running on Windows Server 2012 R2, and I have just bought and installed an SSL cert from GoDaddy.

I have changed my config to what I think it should be, but it's not working. The website is still working over http, but I get a timeout over https. I'm hoping it's something really simple that I'm missing. This is the first time I've tried to install an SSL cert with nginx.

nginx.conf

worker_processes 1;

events {
    worker_connections 1024;
}

http {
    server_tokens off;
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;

    # http://stackoverflow.com/questions/12640014/enable-gzip-for-css-and-js-files-on-nginx-server-for-magento
    gzip on;
    gzip_comp_level 6;
    gzip_min_length 1100;
    gzip_buffers 16 8k;
    gzip_proxied any;
    gzip_types
        text/plain
        text/css
        text/js
        text/xml
        text/javascript
        application/javascript
        application/x-javascript
        application/json
        application/xml
        application/rss+xml
        image/x-icon
        image/svg+xml;

    # http://nginx.org/en/docs/http/server_names.html
    server_names_hash_bucket_size 64;

    server {
        listen      80;
        server_name localhost;
        access_log  logs/host.access.log;
        error_page  404 /404.html;
        error_page  500 502 503 504 /50x.html;

        location / {
            root   html;
            index  index.html index.htm;
        }
        location = /50x.html {
            root   html;
        }
    }

    include websites/*.conf;
}

/websites/domain-co-uk.conf

server {
    server_name domain.co.uk;
    return 301  $scheme://www.domain.co.uk$request_uri;
}

server {
    listen              80;
    listen              443 ssl;
    server_name         www.domain.co.uk;

    ssl_certificate     /nginx/conf/ssl/domain-co-uk/1234.crt;
    ssl_certificate_key /nginx/conf/ssl/domain-co-uk/domain.key;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;

    access_log          logs/domain-co-uk-access.log;
    charset             utf-8;
    location / {
        proxy_pass http://localhost:4008/;
    }
}

I can't see any issues in the logs.

Websites:

Visiting https://www.thepreventduty.co.uk/ from the server itself works.

Why is the https version not working externally..?

1
  • 1
    "Why is the https version not working externally..?": Because port 443 is not reachable from the outside.
    – gf_
    Nov 18 '16 at 16:54
1

You have port 443 firewalled. Open this port.

0

You have to set listen 443 ssl;

1
  • I have = listen 111.111.111.111:443 ssl;. I've tried it without the IP, same result. Also, with the IP the https doesn't work with either the domain name or the IP in a browser. Nov 18 '16 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.