Basic Question: Unable to access https:// with www prefix

Richard Stanway r1ch+nginx at teamliquid.net
Thu Aug 4 16:43:53 UTC 2016


This is not nginx redirecting, as there is no response body. Most likely it
is your wordpress configuration that needs attention.

On Thu, Aug 4, 2016 at 5:03 PM, lukemroz <nginx-forum at forum.nginx.org>
wrote:

> Hello,
>
> I followed the instructions at Digital Ocean for setting up a WordPress
> installation, including enabling HTTPS on the nginx server.
>
> (The instructions are here:
> https://www.digitalocean.com/community/tutorials/how-to-
> secure-nginx-with-let-s-encrypt-on-ubuntu-16-04)
>
> When accessing https://www.comfortglobalhealth.com, I am always redirected
> to https://comfortglobalhealth.com.  Can someone suggest what change I
> need
> to make to my nginx configuration file so that this redirect doesn't
> happen?
>
> Thanks,
> Luke
>
> Here is my config:
>
> server {
>         listen 80 default_server;
>         listen [::]:80 default_server;
>         server_name comfortglobalhealth.com www.comfortglobalhealth.com;
>         return 301 https://$server_name$request_uri;
>         }
>
> server {
>         listen 443 ssl http2 default_server;
>         listen [::]:443 ssl http2 default_server;
>         include snippets/ssl-comfortglobalhealth.com.conf;
>         include snippets/ssl-params.conf;
>         root /var/www/html;
>         index index.php index.html index.htm index.nginx-debian.html;
>         server_name comfortglobalhealth.com www.comfortglobalhealth.com;
>     location = /favicon.ico { log_not_found off; access_log off; }
>     location = /robots.txt { log_not_found off; access_log off; allow all;
> }
>     location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
>         expires max;
>         log_not_found off;
> }
>
>         location / {
>                 try_files $uri $uri/ /index.php$is_args$args;
>         }
>         location ~ \.php$ {
>                 include snippets/fastcgi-php.conf;
>
>                 fastcgi_pass 127.0.0.1:9000;
>         }
>         location ~ /\.ht {
>                 deny all;
>         }
>         location ~ /.well-known {
>                 allow all;
>         }
> }
>
> Here are my snippets:
>
> ssl-comfortglobalhealth.com.conf:
> ssl_certificate
> /etc/letsencrypt/live/www.comfortglobalhealth.com/fullchain.pem;
> ssl_certificate_key
> /etc/letsencrypt/live/www.comfortglobalhealth.com/privkey.pem;
>
> ssl-params.conf:
> ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
> ssl_prefer_server_ciphers on;
> ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
> ssl_ecdh_curve secp384r1;
> ssl_session_cache shared:SSL:10m;
> ssl_session_tickets off;
> ssl_stapling on;
> ssl_stapling_verify on;
> resolver 8.8.8.8 8.8.4.4 valid=300s;
> resolver_timeout 5s;
> add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
> add_header X-Frame-Options DENY;
> add_header X-Content-Type-Options nosniff;
> ssl_dhparam /etc/ssl/certs/dhparam.pem;
>
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?2,268775,268775#msg-268775
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160804/a6e6481c/attachment.html>


More information about the nginx mailing list