1

I am curretly working on a project where WWW subdomain isn't resolving since I moved from my previous server and make my DNS point to the new IP address. Has it something to do with HSTS settings ? SSL certificates ? Wrong redirect format ? Wrong CNAME ?

On the previous server:

  • I issued a SSL certificate using LetsEncrypt for both domains : website.fr and www.website.fr., running with Debian/Apache
  • I terminated the instance without copying the certificate.
  • At that time, it worked on both https www and non www

On the new server:

  • I've created an AWS EC2 under Ubuntu16.04/Nginx
  • I've issued a new SSL for both domains using LetsEncrypt
  • Sites-available conf file (enabled):

    server {
     listen 80 default_server;
     listen [::]:80 default_server;
     server_name website.fr www.website.fr;
     return 301 $scheme://website.fr$request_uri;
    }
    
    server {
     listen 443 ssl http2;
     listen [::]:443 ssl http2;
     server_name www.website.fr;
     ssl_certificate /etc/letsencrypt/live/website.fr/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/website.fr/privkey.pem;
     include snippets/ssl-params.conf;
     return 301 $scheme://website.fr$request_uri;
    }
    
    server {
     listen 443 ssl http2 default_server;
     listen [::]:443 ssl http2 default_server;
     ssl_certificate /etc/letsencrypt/live/website.fr/fullchain.pem;
     ssl_certificate_key /etc/letsencrypt/live/website.fr/privkey.pem;
     include snippets/ssl-params.conf;
     root /var/www/...
     ...etc...
    
  • ssl-params.conf

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECD$
    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; #Diffie-Hellman 2048 group
    

DNS Zone settings:

IN A XX.XX.XX.XX
* IN CNAME website.fr.
www IN CNAME website.fr.

Why isn't my WWW-Subdomain also resolving ? Why isn't the page showing ?

dimitri
  • 348
  • 2
  • 6

2 Answers2

1

Problem solved by itself...

Apparently, nothing was wrong in the configuration. DNS needed A LOT OF TIME to spread (24h+).

Just needed to be patient :)

dimitri
  • 348
  • 2
  • 6
0

You need to point another A Record with the host "www" to your IP. This needs to be done wherever you bought the domain.

NullDev
  • 6,739
  • 4
  • 30
  • 54
  • Thanks @NullDev, I've also tried that yesterday, waited for a few hours but it didn't seem to work. – dimitri Feb 17 '17 at 10:30