Comments on A Guide to running a Reverse proxy for HTTP(S), SSH and MySQL/MariaDB using NGINX

This guide will walk you through the installation and configuration of NGINX to allow for the running of multiple physical servers, virtual machines or a combination of both behind a single public-facing IP Address.

7 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Petter Neumann

What if you have a exsisting site running on the Nginx server and want to serve this site directly from the Reverse proxy host server ?

I have Nginx running a site at my server now, and want to add the reverse proxy functionality to have a separate server running Nextcloud.  My site sits behind a firewall/router and is named  example.com and have a ip of  192.168.1.5 (everything works great)

I want to add an additional server to be used for my Nextcloud,  nextcloud.example.com  ip 192.168.1.6.  The main server 192.168.1.5 run ssd's for performande, but for the other server 192.168.1.6 the main objective is large disk spacee and low cost disc's

By: Sam

Typo in /etc/nginx.conf

include /etc/nginx/rproxy/streams/enabled/*.conf;

 

should be:

include /etc/nginx/rproxy/stream/enabled/*.conf;

 

By: Markus

Thank you very much for that fine tutorial!I'd like to contribute at last a little: If I am not mistaken, there is a mistake you might correct:# Note down the listen ports upstream web1-ssh { server 192.168.1.3:22; } server { listen 22002; proxy_pass web1-ssh; } It should be web1-ssh two times (and NOT web1-ssh one time and web-ssh the other)...

By: Tommy

I think leverage the Stream submodule in nginx http section could be better. like  stream { upstream web-ssh{server 172.0.0.123:22}  server{listen 22001; proxy_pass web-ssh;}}

By: Nishanth

Thanks! This was very useful.

By: Chris_UK

Peter: Existing site is not an issue, don't comment out the line to sites enabled and they will be servers as normal directly from nginx.

Sam: You are correct stream in this case not streams, although either will work as long as your nginx.conf include path matches your configurations path.

Markus: Thank you, and yes it should you are correct the servers proxy_pass line should have matched the stream definition.

Tommy: I will look into that. I wrote this after a lot of digging around and I agree it might not be the best approach.

Nishanth: Thank you.

 

I appreciate all of your feedback, I will try to get this tutorial corrected in the next few days, I am going to look into Tommy's suggestion first to see if I can improve the tutorial.

By: Stone Johnson

I run a home web server that supplies web pages (apache2) and supports ssh logins.  We are going to switch to T-Mobile's new 5G gateway which does not allow port forwarding.  Will nignx allow one to be able to ssh in to the server from outside the LAN and allow it to respond to http requests?