Redirect www to apex

I’ve just issued a cert for my apex domain. Is there a best practice for redirecting www to apex? I cannot, to my knowledge, do this at the DNS level. I suppose I could configure my application to handle a redirect once the request hits my request handler.

But I’m wondering if there’s a preferred path. Namely, could I use a custom Nginx config? If I do this at the Nginx level, then I’m tidying up the request before it ever hits my application backend.

(Stupid bonus question. I assume Nginx is sitting there, since the request comes in on 443 and is forwarded to 8080. But I actually don’t know that Nginx is already there. Perhaps there is some other kind of magic and I’ll have to install Nginx myself via Docker?! That would make me very sad.)

Thank you so much!

Your app is the best place to configure this. Most app frameworks have a setting that makes it simple, which framework are you using?

Note that you’ll still have to create a certificate for www. to allow your app to do this!

We don’t run nginx, but we do run a proxy that does some of what you’d expect nginx to do. You could run your own nginx to manage redirects. That’s more complicated than what I’d like though.

App it is then. Thank you so much for the quick reply.

1 Like