Virtual Hosts in NGINX vs Apache

Issues related to applications and software problems
Post Reply
mcheoti
Posts: 36
Joined: 2016/02/13 10:07:42
Location: Austria
Contact:

Virtual Hosts in NGINX vs Apache

Post by mcheoti » 2017/11/08 10:43:27

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>
ServerName server1.mydomain.com
    DocumentRoot /var/www/html/cms1
</VirtualHost>

<VirtualHost *:80>
ServerName server2.mydomain.com
     DocumentRoot /var/www/html/cms2
</VirtualHost>
But how can i do that in NGINX ? I mean setting up, things like this Link:
https://www.digitalocean.com/community/ ... 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/ http://192.168.8.1:8080/ui/ timeout=360
       ProxyPassReverse /ui/ http://192.168.8.1:8080/ui/
...
</IfModule>
Do you have an idea ?
Cheers Ch

Post Reply