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: [ Ссылка ]
Helpful sites:
[ Ссылка ]
[ Ссылка ]
----------------------------------------------------------------------------------------------
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 [ Ссылка ];
}
}
server {
listen 80;
server_name yourdomain2.info www.yourdomain2.info;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass [ Ссылка ];
}
}
nginx -t
systemctl reload nginx
systemctl status nginux
![](https://i.ytimg.com/vi/x1fnOJsX6wE/maxresdefault.jpg)