Page 1 of 1

Virtual Hosts in NGINX vs Apache

Posted: 2017/11/08 10:43:27
by mcheoti
Hi everyone!

I want to add more than one virtual host on my server. On Apache it is an easy task,
Edit the httpd.conf and add 2 entries, restart the server and done.

Code: Select all

<VirtualHost *:80>
    DocumentRoot /var/www/html/cms1

<VirtualHost *:80>
     DocumentRoot /var/www/html/cms2
But how can i do that in NGINX ? I mean setting up, things like this Link: ... n-centos-7
is a little bid strange for me. is there an easier way ?

I mean the next step in my config would be to forward the request to another internal IP Adress.
In the ssl.conf it was possible via

Code: Select all

<IfModule mod_proxy.c>
       ProxyPass /ui/ timeout=360
       ProxyPassReverse /ui/
Do you have an idea ?
Cheers Ch