I'm sorry if this is a dumb question. I'm very new to backend stuff.

I'm trying to set up a Rocket Chat server onto a server that I set up a NextCloud and Wikimedia server previously.

The rocket chat documentation says that I need to set up a reverse server proxy to route incoming traffic to the rocket chat server. I asked about a problem I was having on their forum and someone told me I need to set up a virtual host (which I also vaguely remember doing for nextcloud and wikimedia). But when I look up setting up a virtual host, it looks exactly like setting up a reverse server proxy. Am I misunderstanding something? What's the difference between the two?

Here's the relevant RocketChat documentation describing setting up the reverse server proxy: https://rocket.chat/docs/installation/manual-installation/configuring-ssl-reverse-proxy/

And here's a page talking about setting up a virtual host: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

In both cases I'm adding a configuration file to the sites-enabled folder that tells incoming traffic how to delegate incoming information, right? If I'm understanding it correctly?

EDIT: In what way am I requesting learning material? I'm not, I'm asking a specific question about a specific distinction. There are TONS of questions like this all over stack exchange. Examples: https://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter


closed as off-topic by TomTom, yagmoth555 Jan 10 at 11:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Have you tried reading the documentation? (or the nginx equivalent?) – Gerald Schneider Jan 10 at 8:14
  • Yes, but this does not directly address the differences between the two. The documentation you link merely shows how to set one up. Is virtual hosts just the Apache terminology for a reverse proxy server? Also is downvoting my post really necessary? My question may seem elementary to more experienced people but it's perfectly within the stack exchange rules for asking questions. – David A. French Jan 10 at 8:22
  • It is knowledge that people are expected to have when they ask questions here. VirtualHosts and Reverse Proxy are completely different concepts. The only thing they have in common is that a reverse proxy is usually configured inside a VirtualHost (or server block, as it is called in nginx configs). – Gerald Schneider Jan 10 at 8:28
  • @GeraldSchneider That's an absurd piece of gatekeeping. Last time I checked Stack sites didn't have minimum accreditation requirements to ask questions. It's a website for asking questions and with that comes people who are beginners. – David A. French Apr 18 at 6:49

It is not so difficult to understand the different between a virtual host and a proxy.

A virtual host define and delimit a configuration for a specific domain name, with this you can host multiples web service on the same http server (use http because it is generic)

A proxy, instead, is a configuration which instruct the http server for a certain domain name or url the http service is not local but is served by a remote or another httpd server.

normally you will set proxy configuration in a virtual host.

Update add example with in-line comment

This is the definition of Vhost listen on all interfaces on port 80:

<VirtualHost *:80>

The domain name this Vhost will answer:

    ServerName exampledomainA.it

an alias of the domain name:

    ServerAlias www.exampledomainA.it

Local path defined this code will execute when you visit http://exapmledomainA.it

    DocumentRoot /var/www/html

proxy definition, tell web server to forward request for exampledomainA.it/phpmyadmin to http://www_phpmyadmin/

    ProxyPass "/phpmyadmin" "http://www_phpmyadmin/"
    ProxyPassReverse "/phpmyadmin"  "http://www_phpmyadmin/"

proxy definition, tell web server to forward request for exampledomainA.it/blog to http://www_domainA/

    ProxyPass "/blog"   "http://www_domainA/"
    ProxyPassReverse "/blog"    "http://www_domainA/"

Other Proxy definitions:

    ProxyRequests Off
    ProxyPreserveHost On
    RewriteEngine on

end of the virtual host

  • Thank you @AtomiX84 So it sounds like what you're saying is that a proxy is a specific type of configuration for a virtual host? So you can have a virtual hosts with many different kinds of configurations, and a reverse proxy is one kind of virtual host configuration? Am I understanding that correctly? – David A. French Jan 10 at 9:05
  • 1
    @DavidA.French No, that is still slightly too simplified as a reverse proxy does not have to apply for the whole virtual host, you can configure / restrict the reverse proxy configuration directives to only act on one or more specific URI path's i.e. only reverse proxy /app1 to a different application server and /remote/content to a remote server where the rest of www.expample.com/ is local content – HBruijn Jan 10 at 9:34
  • Ooooh okay, please bare with me in checking to see if I fully understand. The reverse proxy is just the part of the virtual host configuration which is specifying how to pass forward incoming requests to a specific remote or httpd server, correct? The virtual host could pass forward that request to local content, but the reverse proxy is the specific configuration related to passing it on to something remote (which is why I'm seeing so many articles discussing it in the context of load balancing). I'm sorry if this is very simple, I'm just trying to make sure I fully understand. – David A. French Jan 10 at 9:49
  • Not really, the virtual host define a configuration for a certain domain, for example for domain example.org you go to define a virtual host were you server will listen for request of example.org, inside the virtual host you can define some location, this location could point locally or be a proxy config, as per @HBruijn says, imaging configure the location / for a virtual host point to a local path where the code is stored, one path /blog point to a remote server and another /forum point to another remote, so /blog and /forum will have they own proxy config inside the virtual host example.org – AtomiX84 Jan 10 at 10:12
  • hope the update, clarify better. – AtomiX84 Jan 10 at 10:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.