How To Create Reverse Proxy On Server B And Redirect To Server A
Hello Can Anyone Guide Me How To Setup Reverse Proxy On Server-B With Nginx And Redirect Websites To Server-A (empty Websites That Created On Server B )
I Am Currently Doing That Via aaPanel But Its Not Stable.
Please Guide Me With Another Way.
Thanks
2 Replies
Hey there -
While I haven't tried to do this myself, I wanted to give you some resources that should be able to help you out.
First off, we have a guide that shows you how to set up reverse proxy with Nginx:
Also, here's Nginx's documentation:
We also have another post here in the Linode Community that goes into it a bit deeper and discusses using the Nginx reverse proxy for an outside resource - which may be what you're trying to do:
Reverse-Proxy for Outside Resource
I hope this helps!
This is relatively straight forward to do.
As @rgerke highlighted, this is called reverse proxying.
A sample config would look something like this (this is a site using SSL, so the extra bits are for the SSL):
server {
listen 443 ssl;
server_name server-b.com;
ssl_certificate /etc/ssl/certs/server-b.crt;
ssl_certificate_key /etc/ssl/certs/server-b.key;
resolver 127.0.0.53;
location / {
proxy_pass https://server-a.com$uri$is_args$args;
}
}