How to host multiple websites on Nginx
Ғылым және технология
server {
listen 80;
server_name absprog.com;
location / {
root /var/www/absprog.com;
index index.html;
}
}
server {
listen 80;
server_name absprog.com;
location / {
root /var/www/absprog.com;
index index.html;
}
}
Пікірлер: 21
Uauuuu, I ask you yesterday, and today you have done it. A great hug from Brazil to you Matan.
@absprog
5 ай бұрын
Thanks for your support. Hugs right back to you.
thank you. to the point and worked perfectly.
@absprog
4 ай бұрын
Glad to hear that!👍
I am trying to use the reverse-proxy.conf file and multiple server blocks. But it only redirects to first server block always. Why do you think that happens?
It works if sites are hosted in another VMs? I mean, I have two websites hosted on two different VMs. Could I use NGINX to forward the traffic to this websites based on the URLs used?
When I put www. Infront of the domain it does not work. How can i fix that
@QBarszcz
21 күн бұрын
put a new record that has name www and points to the same server
thank you so much
@absprog
3 ай бұрын
You're most welcome!
Will restarting Nginx cause downtime on the website?
@absprog
4 ай бұрын
Brief downtime, usually two or three seconds.
can you asign the domains to the ip after?
@absprog
4 ай бұрын
Yes, you just add an “A” record to the domain, with the IP as its value, where you manage your domains.
Thanks !!
@absprog
Күн бұрын
You're most welcome👍
you are my life saver! thank you bro keep it up
@absprog
Күн бұрын
Thanks for your support👍