---
title: "Deploy nginx-password-auth"
description: "Put any service behind a username / password"
category: "Authentication"
url: https://railway.com/deploy/nginx-password-auth
---

# Deploy nginx-password-auth

Put any service behind a username / password

**[Deploy nginx-password-auth on Railway](https://railway.com/template/nginx-password-auth)**

- **Creator:** Ben Williams's Projects
- **Category:** Authentication
- **Total deploys:** 27

## Template content

### nginx-password-auth

- **Source:** biw/railway-nginx-password-auth
- **Public domain:** Yes

## Documentation

# Deploy and Host nginx-password-auth on Railway


A lightweight nginx-based reverse proxy with HTTP Basic Authentication. Allows you to put any service behind a username/password


## About Hosting railway-nginx-password-auth

Set the internal network of your service as `ORIGIN` and your username / password as `BASIC_AUTH`:


| Variable           | Required | Description                                         | Example                     |
| ------------------ | -------- | --------------------------------------------------- | --------------------------- |
| `ORIGIN`           | ✅       | The upstream URL to proxy to                        | `https://myapp.railway.internal:3000` |
| `BASIC_AUTH`       | ✅\*     | Username and password in `username:password` format | `admin:mysecretpass`        |
| `BASIC_AUTH_REALM` | ❌       | Authentication realm message                        | `"Restricted Area"`         |
| `ALLOW_NO_AUTH`    | ❌       | Set to `"true"` to disable auth requirement         | `"true"`                    |

## Common Use Cases

- Protecting Development/Staging Environments
- Adding Auth to Public APIs

## Dependencies for railway-nginx-password-auth Hosting

None

### Deployment Dependencies

None

## Why Deploy railway-nginx-password-auth on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying railway-nginx-password-auth on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Keycloak](https://railway.com/deploy/mSwigX) — Keycloak template with keywind theme + apple and discord providers
- [lua-protector](https://railway.com/deploy/lua-protector) — Test deployed my project first
- [bknd](https://railway.com/deploy/p4nTYL) — Feature-rich yet lightweight backend

Open this page in a browser: https://railway.com/deploy/nginx-password-auth
