I am running my app on 10.3.23.23:3000 but the i would like to access at 80 port instead 3000 but the same time i dont want to change app config. what are ohter ways we have
If you want your application to be accessible on port 80 without changing its configuration (which currently runs on port 3000), you can use a reverse proxy or port forwarding. These methods allow you to keep your application running on its original port while externally it appears to be running on port 80. Here are a few approaches:
1. Using a Reverse Proxy
A reverse proxy server sits in front of your application and forwards client requests to the application backend. This is a common way to expose applications running on non-standard ports to standard ports like 80 (HTTP) or 443 (HTTPS).
Nginx
Hereβs an example configuration for Nginx. If you donβt have Nginx installed, youβll need to install it first.

After configuring, restart or reload Nginx for the changes to take effect.
Apache
If youβre using Apache as a web server, you can configure it to act as a proxy using mod_proxy
and mod_proxy_http
. Hereβs an example configuration:
Ensure that mod_proxy
and mod_proxy_http
are enabled, then restart Apache.

2. Using iptables for Port Forwarding
If youβre running a Linux server and prefer not to use a reverse proxy, you can use iptables
for port forwarding. This method routes traffic coming into port 80 to port 3000.
Hereβs how to forward port 80 to port 3000 using iptables
:
To make the rule persistent across reboots, youβll need to install iptables-persistent
or manually add the rule to your startup scripts, depending on your Linux distribution.
$ sudo apt-get update
$ sudo apt-get install iptables-persistent
$ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
Save Your Rules Manually: If you've already installed iptables-persistent or if you need to save new rules after installation, you can save your current iptables rules by executing:
$ sudo netfilter-persistent save
3. Using a Load Balancer
If youβre deploying your application in a cloud environment (like AWS, GCP, Azure), you can use their load balancer services to forward traffic from port 80 to port 3000. Youβll need to set up a load balancer, point it to your application, and configure the listeners to forward traffic from port 80 to port 3000. This approach also gives you the benefit of scaling, SSL termination, and more, depending on the cloud providerβs offerings.
Each of these methods allows you to expose your application on port 80 without changing the applicationβs configuration. Choose the one that best fits your environment and needs.
Iβm a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND