nginx reverse proxy on separate vps

I've read about people running apache on a nonstandard port, and setting up nginx on the same box to proxy requests listening on 80. I want to do something like this, but with the reverse proxy running on its own, separate VPS.

My thinking: I'm deploying what I would like to be a scalable, high-availability web app. If I have to take the main server down for maintenance/move/whatever, or if it goes down on its own, I can display a friendly "check back later" message to users instead of their connection timing out. Also, if I had to set up load balancing down the line this would make it easier.

I would get 2 linodes in the same datacenter, and use the private IP feature for traffic between them. My only concern is, would shuttling the requests between two VPS's incur a performance penalty? Any thoughts?

I'd probably be running nginx on both nodes, if it matters.

2 Replies

I don't think you should really be that worried about the performance. The private network is fast.

Pings:

0.436ms: Public

0.273ms: Private

0.043ms: Localhost

Do your applications work well with clustering? If you setup two identical Linodes in the same DC and buy a third IP, you could map your DNS to the third IP, and then bring it up on whichever VPS you want (so you can move the IP before maintenance).

You're right. I just ran some tests, and it appears the extra latency is on average around 1/5000th of a second. :) Awesome.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct