---
title: "How to set up Nginx as a reverse proxy on a VPS | StreetHosting"
description: "Use Nginx to put your apps behind a single address, with a domain, HTTPS and several internal ports. A reverse proxy guide for Node apps, panels and APIs."
url: "https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps"
type: "page"
language: "en-US"
---

VPS · 3 min · Intermediate

Published on Jun 17, 2026 · Updated on Jun 17, 2026

# Nginx reverse proxy on a VPS

Your app runs on an internal port and you want to serve it on a domain with HTTPS. Nginx as a reverse proxy solves that and also brings several apps together in one place.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Network, DNS and domains](https://streethosting.com.br/en/guides/topics/networking) [Deploying and running apps](https://streethosting.com.br/en/guides/topics/deploy)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=How%20to%20set%20up%20Nginx%20as%20a%20reverse%20proxy%20on%20a%20VPS&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps "Share on LinkedIn") [](https://wa.me/?text=How%20to%20set%20up%20Nginx%20as%20a%20reverse%20proxy%20on%20a%20VPS%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fnginx-reverse-proxy-vps "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps.md)

In this guide 5 sections

* [What a reverse proxy is](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#o-que-e)
* [Install and test](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#instalar)
* [Configure the proxy](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#configurar-proxy)
* [HTTPS and domain](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#https)
* [Multiple apps](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#varias-apps)

Quick answer

To use **Nginx as a reverse proxy**, install Nginx, create a server block for your domain and forward requests to the app's internal port with the proxy directive. Then enable HTTPS by issuing a certificate. That way you serve internal apps under a secure domain and bring several of them together in one place.

## What a reverse proxy is[](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#o-que-e)

Your app, such as a Node API, usually runs on an internal port that nobody should reach directly. The reverse proxy sits in front: it receives the traffic on the domain, decides which app to send it to and passes the response back. The visitor never talks to the internal port, only to Nginx.

## Install and test[](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#instalar)

1. Install Nginx with the system package manager.
2. Confirm the default page opens at the VPS IP.
3. Make sure the firewall allows the web port.

Before pointing the domain, check that DNS already resolves to the VPS IP. Without that, the HTTPS certificate cannot be issued.

## Configure the proxy[](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#configurar-proxy)

Create a server block for the domain and use the proxy directive to forward requests to the app's internal port. Pass the host and original IP headers along so the app can see the real visitor. Test the configuration and reload Nginx.

Always validate the Nginx configuration before reloading. A syntax error can take down every site on the VPS at once.

## HTTPS and domain[](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#https)

With the proxy up, enable HTTPS by issuing a certificate for the domain. Nginx is the ideal place to terminate the encryption. Follow the step-by-step guide in [SSL certificate with Let's Encrypt and Nginx](https://streethosting.com.br/en/guides/vps/lets-encrypt-ssl-certificate-vps).

## Multiple apps[](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#varias-apps)

* One server block per domain
* Each app on its own internal port
* HTTPS configured on every domain
* Separate logs per site for troubleshooting

To host several projects on the same machine, combine this with [multiple sites on the same VPS](https://streethosting.com.br/en/guides/vps/multiple-websites-on-one-vps). To run many apps with room to spare, check out the lineup on [VPS plans](https://streethosting.com.br/en/vps).

In this guide

* [What a reverse proxy is](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#o-que-e)
* [Install and test](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#instalar)
* [Configure the proxy](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#configurar-proxy)
* [HTTPS and domain](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#https)
* [Multiple apps](https://streethosting.com.br/en/guides/vps/nginx-reverse-proxy-vps#varias-apps)

## Frequently asked questions

What is a reverse proxy?

It is an intermediary that receives requests from the internet and forwards them to the right app running on an internal port. The visitor talks to Nginx, and Nginx talks to your app.

Why not expose the app directly on its port?

Because the reverse proxy centralizes the domain, HTTPS, logs and security in one place, and lets you run several apps on the same VPS under different domains, all through the standard web port.

Do I need HTTPS on the reverse proxy?

Yes, for anything public. Nginx is the ideal place to terminate HTTPS, issuing and renewing the certificate, while the internal app stays simple on its own port.

Can one Nginx serve several apps?

Yes. Each app gets a server block with its own domain and internal port. It is the standard way to host several projects on the same VPS in an organized way.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

[See Ryzen VPS Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.](https://streethosting.com.br/en/vps/ryzen) [See Xeon VPS Xeon VPS for steady workloads, automation and long-running projects.](https://streethosting.com.br/en/vps/xeon)

## Related guides

[VPS Intermediate How to host multiple websites on one VPS with Nginx A well-configured VPS can carry several small projects. The trick is separate server blocks, a default server that rejects unknown domains, one Linux user and one PHP pool per site, and independent certificates. 9 min Read guide](https://streethosting.com.br/en/guides/vps/multiple-websites-on-one-vps) [VPS Beginner SSL certificate on a VPS with Let's Encrypt and Nginx A site without the padlock loses trust and rankings. This guide shows how to issue, renew and audit a free SSL certificate on your VPS with Nginx and Certbot. 4 min Read guide](https://streethosting.com.br/en/guides/vps/lets-encrypt-ssl-certificate-vps) [VPS Intermediate How to host a Node.js app on a VPS in Brazil A Node.js app in production needs a process manager, a reverse proxy, HTTPS and automatic restarts. Follow the complete walkthrough on an Ubuntu VPS in São Paulo, close to your users and to Brazilian integrations. 9 min Read guide](https://streethosting.com.br/en/guides/vps/host-nodejs-on-vps)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
