I am completely new to NGINX, never even touched it, however I'm in a little situation where looking online points to needing to use it.
My situation is this:
I have 1 server (Windows Server) and I want to run two FTP servers and two webservers. Now, I know I cannot host two applications on the same port (say port 80 for both webservers etc) and therefore I will have to put them on different ports.
For this situation, lets say I have two subdomains one.example.com
and two.example.com
. Both of these subdomains point to my server's IP address 1.2.3.4
. In any normal situation, accessing either webserver and either FTP server through either subdomain will be possible, on the different ports I have assigned. This is not what I want.
What i'd like to do is have one FTP server and one webserver on one subdomain, and on port 21 and 80, and the other FTP server and webserver on the other subdomain, and again on port 21 and 80.
As far as I can tell, I need to make it that you can only access certain things (filter) on certain subdomains, and the ports of those things (21 and 80) get translated to other ports on the server (as you can't have two applications residing on one port).
If I can, i'd like to run NGINX on the windows server, but if not I really would need it running on something small like my Raspberry Pi, even if that requires my Pi to be a gateway between the internet and my network.
EDIT: It is important for me to note here that I intend to run more than just FTP and HTTP on this server, so this port translation and domain filtering needs to work on any kind of socket application, not just FTP, HTTP etc. If NGINX is not the solution, any other working solution is ok.