You symbolize the default file from sites available for permitted sites. Then you modify the available site to include two server blocks, each with a different server name. see the following. It is assumed that you have domains called example.com and example2.com. You would also point @records to the ip address of the server on which you installed nginx.
Symlink accessible site to permitted site
sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
edit the file using your chosen editor (vim for me)
sudo vi /etc/nginx/sites-available/default
Here is the contents of a working nginx conf if you use web applications on ports 4567 and 4568.
server { server_name www.example.com location / { proxy_pass http://localhost:4567/; } } server { server_name www.example2.com location { proxy_pass http://localhost:4568/; } }
jmontross Oct 19 '13 at 9:22 2013-10-19 21:22
source share