Https not redirecting to www (nginx)

My domain is:
dribbler.io

Inside ~/etc/nginx/conf.d/redirect.conf I added lines to redirect non-www to www, on top of what certbot automatically added to my conf file:

server {
    server_name dribbler.io;
    return 301 https://www.dribbler.io$request_uri;
}

What works:
http://dribbler.io -- > https://www.dribbler.io
http://www.dribbler.io --> https://www.dribbler.io

What does not work and I don't know why:
https://dribbler.io --> it doesn't redirect to https://www.dribbler.io

Hello @pax_v, welcome to the Let's Encrypt community. :slightly_smiling_face:

This is not a Let's Encrypt nor Certificate issue.
However nginx has a forum and a community that maybe able to assist.
https://forum.nginx.org/

2 Likes

Here is a good reference on how to do that. They redirect www to apex so just switch them around for your needs.

3 Likes

That block might need a listen statement.
Seems like you are just begining to use nginx...
If so, you should try to learn the basics first.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.