Report this

What is the reason for this report?

Can't access site via https after installing ssl certificate (Nginx, Ubuntu 14.04)

Posted on October 23, 2017

I am getting the “took too long to respond” timing out error in browser. There is an issue accessing the site on port 443 but there are no firewalls.

This is not the default server block. I have another site on SSL however that is an “external” cloudflare ssl.

No errors in nginx logs.

Here is the server block:

server {
       listen 80;
       listen [::]:80;
       listen 443 ssl;

       server_name mydomain.com www.mydomain.com;

      # return         301 https://$server_name$request_uri;

        error_log    /var/log/nginx/mydomain.com.error.log debug;

        root /var/www/mydomain.com/html;
        index index.php;

        set $cache_uri $request_uri;

	# POST requests and urls with a query string should always go to PHP
	if ($request_method = POST) {
		set $cache_uri 'null cache';
	}   
	if ($query_string != "") {
		set $cache_uri 'null cache';
	} 

        ssl_certificate /etc/nginx/ssl/mydomain/ssl-bundle.crt;
        ssl_certificate_key /etc/nginx/ssl/mydomain/mydomain.key;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

        # Use cached or actual file if they exists, otherwise pass request to WordPress
	location / {
		try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args ;
        }

        location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
        expires max; log_not_found off; access_log off;
        add_header Pragma public;
        add_header Cache-Control "public";
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_buffer_size 128k;
                fastcgi_buffers 4 256k;
                fastcgi_busy_buffers_size 256k;
        }
}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.