Web Engineering (TU Wien) - L7: Web Servers

preview_player
Показать описание
This is Lecture 7 on Web Servers for TU Wien's course on Web Engineering.
Рекомендации по теме
Комментарии
Автор

Once again, a great lecture!
Just trying to answer a question at 37:08 (having multiple virtual servers on the same IP):
If you want to use Apache/Nginx/Node on the same system and differentiate between them by using different domains that all point to the same IP, you'd normally use some kind of reverse proxy (nginx is quite popular for that).
A reverse proxy receives a request (let's say domainname.com/test.html) and points that request somewhere else (mostly the current IP of the system but with a different port).
So you could have a Node.js web server at Port 4200 and an Apache Server on Port 4300, let's say your IP Adress is 128.130.35.76. You can now set domain1.com to point to 128.130.35.76 and domain2.com to point to 128.130.35.76 (the same address).
Now let's say you want domain1.com to point to your Node.js server and domain2.com to point to your Apache server. You can simply set up an Nginx Proxy that listens at Port 80 and relays requests for domain1.com to port 4200 (your node.js server) and requests for domain2.com to port 4300 (your apache server). That way it is relatively simple to set up multiple servers on the same physical device with one IP but still have completely different servers receiving the request. In our SEPM (software engineering & project management) course, we have an angular app on port 4200 and the rest api on port 8080… A reverse proxy could be configured in the following way:
your-app.com:80 → localhost:4200 (frontend)
api.your-app.com:80 → localhost:8080 (backend)

Reverse Proxies can be used for many other things (like load balancing etc.) but that would go into too much detail (+ I am not really confident in all of this stuff yet)

I hope this helps anybody (especially the person who asked the question at the timestamp)!

justanotheryoutuber
Автор

Very nice lecture, I learned a lot. I think that a better microphone could benefit you though. Its noticeable that you put effort into teaching people!

steff