Nginx Reverse Proxy Set Up ( Multiple Server On The Same Port One IP )

preview_player
Показать описание
How to setup a reverse proxy with Nginx.

# CLI

sudo nano /etc/nginx/sites-available/default

```

server {
listen 80;
server_name HOST_NAME_OF_YOUR_SIT;

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

server {
listen 80;
server_name HOST_NAME_OF_YOUR_SITE;

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

```

sudo systemctl reload nginx

Please like and subscribe!

#TateA
Рекомендации по теме
Комментарии
Автор

Hi guys! Thank you for watching, and please don't forget to
subscribe and like.

If you need any help please leave a comment, I will try to help ASP.

TateA
Автор

Thanks for this video! You really helped me out. Keep going!

abrahaocamelobrandao
Автор

Hi!
Thank you very much for your help!
I watched tons of videos and I did the same thing as what they did, but none of them was helpful. And now I found you, and you've helped me a lot, your video is much shorter than others but has more information and it's more understandable than other's one.


Thank you so much again, hope you're doing great today! :)
See you later!

embersajt
Автор

Greetings from Azerbaijan! The video really amazing and helpful. Thanks a lot! Keep going!

MrAnarguliyev
Автор

Hi, I've watched so many videos on how to do this and never got it working. I followed this without any problems. Excellent video!

daviddesimone
Автор

thanks a lot for this video :) exactly what i was looking for.

PavleStojanovic
Автор

Solid video!!!! Exactly what I was looking for. Your diagram is on point!

Bodybuilderml
Автор

Thanks man. Finally a video on this that works

coursene
Автор

Mano, tu me ajudou muito com esse vídeo. entrei apenas para ver o que faltava de informação no meu arquivo de configuração. Grato !

emersonsantos
Автор

Great Video! I am fairly new to this, so will I have to change the port 80 on the web servers virtual host or can I just leave that? like for example in the header of the virtual host it has <VirtualHost *:80> would I have to change the 80? also I changed the web server to 80.80.80.80, 80.80.81.81 that is manual, do I change this to automatic if I use a reverse proxy? sorry for so many questions, but for the reverse proxy server, in the router settings, do I have that server ip port forwarded to port 80? last question as of now (sorry again if I have more in the future) if I already have a website that hs an ssl certificate from cloudflare and I do the reverse proxy that you showed here, would it affect it at all because what you showed was only http and not https? Thanks! if you need me to clarify more, I will try my hardest to explain what I am asking. Thanks Again.

KylesYTU
Автор

Great work man, could you do docker and nginx with certbot and how to do on production like what things to make sure. Gg

thatrandomguy
Автор

I did exactly the same but nginx strangely only redirecting to the first server block even if the domain name doesn't match. Why do you think it happens?

numankaraaslan
Автор

Did you have to change the /etc/hosts file for this setup? Thanks for the great video.

gabrieloforti
Автор

hello, how do I deny access to a certain internal IP of my network?

LordAlexanderArgr
Автор

Hello i have an question. Is there an time you would need more nginx server to be able to load balance more r/s. like you have 2 nginx servers that get randomly picked from DNS and then they have sub servers they load balance to?

hotvdbp
Автор

Hi guys!!! I need to do it using SSL. I've tried and it doens't work. Can You help me. tks

antoniosergiodemoura
Автор

so the A record must be of the nginx servers IP right?

naturevibezz
Автор

hello. if i add 2-3 servers from different locations after that can i create a vpn server? on that vpn server will be shown the other vps s location which i added before? for exmple in shadowrocked vpn when i make a subscription can i use it other vps servers location all together? could you please help?

orazwepayew
Автор

Can you tell me a little about how I would need to setup my public DNS records?

akjwHTX
Автор

I am setting up with OSSN I am getting too many redirects with the setup you have shown.

smorfnimda