Question

www not redirecting to https://

Posted September 4, 2019 309 views
Nginx WordPress Ubuntu 18.04

Hi,
I have installed wordpress and lets encrypt by using easy engine. However, one problem I am having is that the www. version of my site is not redirecting to the https:// version.
This only seems to affect the home page.
for instance www.mysite.com just returns a nginx 503 error page. https://mysite.com loads just fine.
www.mysite.com/contact-us as a for instance does redirect to https://mysite.com/contact-us

I have created an A name record as recommended in the setup guides
which is hostname www.mysite.com redirects to “IP address”

Any help as to what I am doing wrong would be greatly appreciated.

Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

3 answers

Hello,

I would recommend first starting with the 503 error. You would have to check your Nginx error log for more information:

  • Visit your home page to trigger the error and then run:
tail -100 /var/log/nginx/error.log
  • The error should point you in the right direction for further troubleshooting.

If you are not sure what the error means feel free to share it here and I can try to advise you further.

Also regarding the redirect, I guess that it is something in your config that is missing. Can you share your Nginx server block here so that I could see the exact setup that you have?

Regards,
Bobby

Hi Bobby,

Thanks for the reply.
I have run the error file command and had the follow reply:
tail: cannot open ’/var/log/nginx/error.log’ for reading: No such file or directory

Sorry I am not totally sure how to view the Nginx server block, could you please explain how i can do this.
Thanks

Have you checked your PTR record settings. Seems like you may not have setup the www setting for your IP. There’s a “@” and a “www”.

Submit an Answer