0
1
I got one domain, one subdomain, one IP and multiple servers.
both servers share global IP xxx.xxx.xxx.xxx and are running on the same port 80, 443.
I have been playing around in my router and can't find anything useful.
Both these servers run Apache, PHP 7.3 Server 1 runs Windows and Server 2 on Linux.
And i want this to be the result:
www.mydomain.com Server 1
fileserver.mydomain.com Server 2
Im trying to learn as well so if you could explain this it would be much appreciated.
Since both domain and subdomain point to the same ip, i always endup on "Server 1" (forwarded like that). Could i just add "192.168.x.xx fileserver.mydomain.com" in my host file to make this redirect or will i have to modify something in the apache config? i rather not change ports from 80, 443.
If i would have to add a server/computer/router to the mix in order to make this happen, it wouldn't be a problem.
How would i be able to setup something like this?
Wow, this was awesome! ill do that ASAP Thanks! Great answer and very easy to understand. Now i have learnt a bit as well. :) – Mattias – 2019-07-15T13:09:43.263
Also since this will only be trough SSL i would be able to just forward all *:80 to https to make it even more secure. – Mattias – 2019-07-15T13:21:21.567
Sorry for continuing this thread, im just setting this up, everything works fine when loading the main page of the site from server 1 (trough sever 2) just like described above, except if i have https://my.domain.com/what-ever i get automatically reversed to https://my.domain.comwhat-ever/ ^^ is there a easy fix for that? i have been looking around and this was my buest guess to get an answere that could help me and learn for future things. Thanks!
– Mattias – 2019-08-09T21:30:27.230