Score:0

Reverse proxy and domain forwarding

cl flag

I'm trying to set up a VPS with a single IP address to run my static homepage and some additional services such as NextCloud. I already have a domain that points to the VPS's IP address. Reading through a number of tutorials on self-hosting, a common solution for this type of scenario is to set up a reverse proxy that forwards to different subdomains, e.g. nextcloud.mydomain.com. However, here's my question:

How can I run my static homepage under the main domain, while having services run under subdomains?

All examples I have seen so far serve static content under another subdomain, e.g. blog.mydomain.com. That's not exactly what I want. In fact, I wonder what the response of the reverse proxy is when I try to access the main domain.

I'm using docker and docker-compose for managing the VPS. So far, I tried the jwilder/nginx-proxy and traefik images as reverse-proxies. Any help (literature, relevant tutorials, github repos, etc.) would be highly appreciated!

in flag
Does this answer your question? [How can I forward requests from my web server?](https://serverfault.com/questions/1035016/how-can-i-forward-requests-from-my-web-server)
Score:1
cn flag

Nginx Proxy Manager is what you are looking for: https://nginxproxymanager.com/ It has a fairly simplistic web UI. You can create multiple proxy mappings for all of the subdomains that you want to use. It supports websockets, forwaring, and Let's Encrypt.

You can route traffic using the internal docker network to the containers that are hosting the services.

ChrKoenig avatar
cl flag
Thanks for your answer, but I'm still struggling to understand how I can serve the website without subdomain. I just have a single IP address, and that's where the reverse proxy is running as far as I understand.
cn flag
I assume you are running all of those sites on the same server, and I also assume all sites are containers. If that's the case, you can assign 443 and 80 to nginx proxy manager, then use the internal container IP network. If the "main domain" is running on the host OS and not in a container, then change the port that the web server is bound to (8080,8443), and then set nginx proxy manager to proxy requests for that hostname to 127.0.0.1:8080. You really haven't given enough information to really properly build a recommendation. I have to make a whole lot of assumptions.
ChrKoenig avatar
cl flag
Yeah...server admin and networking are rather new topics for me, so the question might have been a bit vague. Anyways, I got it done using `nginx proxy manager` by simply adding a proxy host that connects the website container to the domain. I somehow thought that wasn't possible and didn't even think of this most obvious solution.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.