Published On Mar 7, 2019
How to run multiple sites on one web-server using Nginx by creating a virtual host.
Also shows how to host dynamic content using port 8080 and 8081
Free Trial on Digital Ocean: https://m.do.co/c/8add28fb64fc
Helpful sites:
https://www.digitalocean.com/communit...
http://nginx.org/en/docs/http/request...
----------------------------------------------------------------------------------------------
commands used during video:
sudo apt install nginx
---show content in "site enable"
unlink default
-- create new conf file in conf.d
newsite.conf
--- past server block into .conf file
server {
listen 80 default_server;
server_name yourdomain1.xyz www.yourdomain1.xyz;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8081;
}
}
server {
listen 80;
server_name yourdomain2.info www.yourdomain2.info;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8080;
}
}
nginx -t
systemctl reload nginx
systemctl status nginux