---
title: "Discussion on \"Proxying to your app running on custom port in NGINX\" | Hashnode"
description: "Discussion on \"Proxying to your app running on custom port in NGINX\". More than ever, if you're managing a server either as an EC2 instance on AWS, or as a VM instance on GCP, or just working on your local machines, proxying to your app's custom port comes in handy if:\n\nYour app uses a protocol other than HTTP/HTTPS\nYo..."
url: "https://hashnode.com/posts/proxy-pass-nginx/609cdda7b684eb4cd52c331d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Proxying to your app running on custom port in NGINX](https://harshitbudhraja.com/proxy-pass-nginx?utm_source=hashnode&utm_medium=feed)

More than ever, if you're managing a server either as an EC2 instance on AWS, or as a VM instance on GCP, or just working on your local machines, proxying to your app's custom port comes in handy if: Your app uses a protocol other than HTTP/HTTPS Yo...

May 13, 2021 · 1 min read · harshitbudhraja.com  
Updated Jan 6, 2022  
Read the article

-   [#nginx](https://hashnode.com/tag/nginx)
-   [#proxy](https://hashnode.com/tag/proxy)

## Written by

[Harshit Budhraja](https://hashnode.com/@hrhv)

@hrhv · Bengaluru, India

  
[View profile](https://hashnode.com/@hrhv)

Product and Engineering 🚀

## Responses 1

Markdown supported · ⌘↵ to post

[Hardeek Sharma](https://hashnode.com/@hardeeksharma)

[May 13, 2021](https://hashnode.com/posts/proxy-pass-nginx/609cdda7b684eb4cd52c331d/comment/609d0de847373d4cb0560a11)

Great article. Can you tell me how to make nginx for sticky sessions. If I have multiple instances of same service running on different port.

[Harshit Budhraja](https://hashnode.com/@hrhv)

[May 13, 2021](https://hashnode.com/posts/proxy-pass-nginx/609cdda7b684eb4cd52c331d/comment/609d0de847373d4cb0560a11#reply-609d1dcf47373d4cb0560dc0)

Hey, I think sticky sessions is something that NGINX Plus offers at the moment. However, I've not really worked with NGINX Plus (as it's not free).

For simple load balancing between multiple instances of the same service running on different ports, here's a configuration that I use:

```
http {
upstream backend {
   server localhost:3000;
   server localhost:3001;
}

server {
        location / {
            proxy_pass backend;
        }
    }
}
```
