nginx ssl virt host issue – site won't load

kambythet asked:

I have configured nginx for port 80 and 443, with 443 containing an ssl cert configuration. When I restart nginx, no errors occur, so I don’t believe it’s a cert issue, but of course I could be wrong.

But, when I load

https://picantewsdev.hotsalsainteractive.com/logo/game/1f126552-9ac4-4db2-b7ce-cede6f38f7ea/ef0c3db2-7cf8-4dc3-bada-625c77cdff80

I get “page cannot be displayed…” browser message. And, I’m not even seeing the request hit the server.

But if I load

http://picantewsdev.hotsalsainteractive.com/logo/game/1f126552-9ac4-4db2-b7ce-cede6f38f7ea/ef0c3db2-7cf8-4dc3-bada-625c77cdff80

The request makes it to the server (albeit a 500 error but that’s fine for now).

Any ideas?

We are not behind a load balancer. This is a server hosted on Rackspace. There’s no hardware firewall or anything like that, either.

Here is the nginx config:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html/public;
    index index.php index.html index.htm;

    server_name picantewsdev.hotsalsainteractive.com;

    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            # add the following line in for added security.
            try_files $uri =403;
    }
}

server {
    listen 443;
    listen [::]:443 default_server ipv6only=on;

    root /usr/share/nginx/html/public;
    index index.php index.html index.htm;

    ssl on;
    ssl_certificate /etc/nginx/ssl_cert/star.hotsalsainteractive.com.chained.crt;
    ssl_certificate_key /etc/nginx/ssl_cert/star_hotsalsainteractive_com.key;

    ssl_session_timeout 5m;

    ssl_protocols SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
    ssl_prefer_server_ciphers on;

    server_name picantewsdev.hotsalsainteractive.com;

    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .php$ {
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            # add the following line in for added security.
            try_files $uri =403;
    }
}

Any help would be appreciated.

Thanks!

My answer:


Your machine isn’t accepting connections on port 443. That’s why the http link works and the https link doesn’t.

This may be because you didn’t reload nginx after making the configuration change, or because you didn’t open port 443 in your firewall(s).


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.