Run Multiple Site from one IP with  reverse proxy Nginx

Run Multiple Site from one IP with reverse proxy Nginx


shared hosting reverse proxy

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

21 thoughts on “Run Multiple Site from one IP with reverse proxy Nginx

  1. hi…

    i need help from you iam working on java JSP page on the tomcat server i can access all post and get method in 80 port but not working in 443 what happens.. and what is the problem can you please explain me or fix this problem

  2. this is how to proxy to different sites based on server name. This means you should run now nginx plus two more servers. If you want to run multiple servers on the same server you just need a different root folder and remove the proxy commands

Leave a Reply

Your email address will not be published. Required fields are marked *