Does NGNIX let you use sub domain “host header” redirections?

In Windows IIS, you can have multiple sites using ports 80,443 if you define a host header, eg, a.example.com, b.example.com.

I’d like to be able to access internal services from the internet without specifying a port, and in some cases force the use of https. Some of these services are windows, other Ubuntu. If I were to setup ngnix (either on the same box as hassio or not) I’d like to be able to have the following redirects occur:

http://hassio.example.com -> https://hassio.example.com
http://ide.example.com -> https://ide.example.com

Assuming I can get ngnix doing these redirects, what would need to be done in hassio? While you can use the base_url option to specify the origin URL, how do you address the fact that hassio and ide each use different ports? I suppose I could have ngnix just handle the port for me, but it would be nice to have a “clean” look about it.

Have a look at this documentation. Also there are several guides here in the forum that help you setting this up. On the top right (on the left of your avatar) there’s a magnifying glass icon. That’s the search function. :+1:

@danielperna84 do you know if the add on works the same as non docker install? One thing I can’t figure out is how this would work with let’s encrypt. If you are using SSL, you need the certs on nginx to forward SSL requests to hassio (and other sites) as well, right? So if I had hassio.example.com I would need an LE cert for both nginx as well as hassio?