Nginx local setup
📰 Dev.to · Željko Šević
Learn to set up Nginx locally for reverse proxying and web serving, and discover how to configure it for various development needs.
Action Steps
- Install Nginx on your local machine using apt or brew
- Configure Nginx to sit on port 80 and route traffic to apps running on other ports
- Set up reverse proxying to forward requests to specific applications or services
- Configure path-based routes to direct traffic to different applications or services based on URL paths
- Serve static files using Nginx and configure it to handle different file types
Who Needs to Know This
This tutorial is beneficial for developers, DevOps engineers, and anyone who wants to set up a local development environment with Nginx. It provides a step-by-step guide on how to install, configure, and use Nginx for reverse proxying, routing traffic, and serving static files.
Key Insight
💡 Nginx can be used as a reverse proxy and web server on a local machine, allowing for flexible routing and serving of applications and static files.
Share This
🚀 Set up Nginx locally for reverse proxying, web serving, and more! 💻
Key Takeaways
Learn to set up Nginx locally for reverse proxying and web serving, and discover how to configure it for various development needs.
Full Article
Title: Nginx local setup
URL Source: https://dev.to/zsevic/nginx-local-setup-4idd
Published Time: 2026-06-20T20:46:54Z
Markdown Content:
# Nginx local setup - DEV Community
[Skip to content](https://dev.to/zsevic/nginx-local-setup-4idd#main-content)
[](https://dev.to/)
[Powered by Algolia](https://www.algolia.com/developers/?utm_source=devto&utm_medium=referral)
[Log in](https://dev.to/enter?signup_subforem=1)[Create account](https://dev.to/enter?signup_subforem=1&state=new-user)
## DEV Community
0 Add reaction
0 Like 0 Unicorn 0 Exploding Head 0 Raised Hands 0 Fire
0 Jump to Comments 0 Save Boost
Copy link
Copied to Clipboard
[Share to X](https://twitter.com/intent/tweet?text=%22Nginx%20local%20setup%22%20by%20%40sevicdev%20%23DEVCommunity%20https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd)[Share to LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd&title=Nginx%20local%20setup&summary=Nginx%20is%20a%20reverse%20proxy%20and%20web%20server.%20On%20a%20local%20machine%20it%20can%20sit%20on%20port%2080%20and%20route%20traffic...&source=DEV%20Community)[Share to Facebook](https://www.facebook.com/sharer.php?u=https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd)[Share to Mastodon](https://s2f.kytta.dev/?text=https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd)
[Share Post via...](https://dev.to/zsevic/nginx-local-setup-4idd#)[Report Abuse](https://dev.to/report-abuse)
[](https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flci9vvwj853l8ahrspmq.png)
[](https://dev.to/zsevic)
[Željko Šević](https://dev.to/zsevic)
Posted on Jun 20 • Originally published at [sevic.dev](https://sevic.dev/notes/nginx-local-setup/)
# Nginx local setup
[#nginx](https://dev.to/t/nginx)[#devops](https://dev.to/t/devops)[#wsl](https://dev.to/t/wsl)
Nginx is a reverse proxy and web server. On a local machine it can sit on port 80 and route traffic to apps running on other ports - a frontend on `:3000`, an API on `:4000`, or a Docker Compose stack with published ports.
This post covers install, config layout, reverse proxying, path-based routes, static files, and service commands on a local dev machine. It does not cover HTTPS, production hardening, or multi-domain TLS.
On Windows, use WSL2 with Ubuntu. On macOS or Linux, the same `apt` or `brew` install steps apply.
### [](https://dev.to/zsevic/nginx-local-setup-4idd#prerequisites) Prerequisites
* WSL2 with Ubuntu (W
URL Source: https://dev.to/zsevic/nginx-local-setup-4idd
Published Time: 2026-06-20T20:46:54Z
Markdown Content:
# Nginx local setup - DEV Community
[Skip to content](https://dev.to/zsevic/nginx-local-setup-4idd#main-content)
[](https://dev.to/)
[Powered by Algolia](https://www.algolia.com/developers/?utm_source=devto&utm_medium=referral)
[Log in](https://dev.to/enter?signup_subforem=1)[Create account](https://dev.to/enter?signup_subforem=1&state=new-user)
## DEV Community
0 Add reaction
0 Like 0 Unicorn 0 Exploding Head 0 Raised Hands 0 Fire
0 Jump to Comments 0 Save Boost
Copy link
Copied to Clipboard
[Share to X](https://twitter.com/intent/tweet?text=%22Nginx%20local%20setup%22%20by%20%40sevicdev%20%23DEVCommunity%20https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd)[Share to LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd&title=Nginx%20local%20setup&summary=Nginx%20is%20a%20reverse%20proxy%20and%20web%20server.%20On%20a%20local%20machine%20it%20can%20sit%20on%20port%2080%20and%20route%20traffic...&source=DEV%20Community)[Share to Facebook](https://www.facebook.com/sharer.php?u=https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd)[Share to Mastodon](https://s2f.kytta.dev/?text=https%3A%2F%2Fdev.to%2Fzsevic%2Fnginx-local-setup-4idd)
[Share Post via...](https://dev.to/zsevic/nginx-local-setup-4idd#)[Report Abuse](https://dev.to/report-abuse)
[](https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flci9vvwj853l8ahrspmq.png)
[](https://dev.to/zsevic)
[Željko Šević](https://dev.to/zsevic)
Posted on Jun 20 • Originally published at [sevic.dev](https://sevic.dev/notes/nginx-local-setup/)
# Nginx local setup
[#nginx](https://dev.to/t/nginx)[#devops](https://dev.to/t/devops)[#wsl](https://dev.to/t/wsl)
Nginx is a reverse proxy and web server. On a local machine it can sit on port 80 and route traffic to apps running on other ports - a frontend on `:3000`, an API on `:4000`, or a Docker Compose stack with published ports.
This post covers install, config layout, reverse proxying, path-based routes, static files, and service commands on a local dev machine. It does not cover HTTPS, production hardening, or multi-domain TLS.
On Windows, use WSL2 with Ubuntu. On macOS or Linux, the same `apt` or `brew` install steps apply.
### [](https://dev.to/zsevic/nginx-local-setup-4idd#prerequisites) Prerequisites
* WSL2 with Ubuntu (W
DeepCamp AI