Skip to content

This is for web applications running in railway.app which need a basic auth without modifing source code. You can add to railway easily by this button.

Notifications You must be signed in to change notification settings

BertramRay/railway-nginx-basic-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Auth Nginx Reverse Proxy for Railway.app's Services

This is for web applications running in railway.app which need a basic auth without modifing source code. image

You can add to railway easily by this button.

Deploy on Railway

Usage

Step 1

Fork this repo, and deploy it in the same project which the services you want to add basic auth.

Step 2

Modify deployed service's enviroment variable. You should know that private network in railway is based on IPV6. So make sure your upstream applications have listened on an IPV6 port.

ENABLE_ALPINE_PRIVATE_NETWORKING

Most important one. You need this for alpine image's network. Just set it to ENABLE_ALPINE_PRIVATE_NETWORKING=true.

PROXY_PASS

The service's private network you want to be proxied. Now supports multiple values separated by commas.

Example: http://app-name.up.railway.app:3000,http://another-app-name.up.railway.app:3000

SERVER_NAME

The server name you want to use. Now supports multiple values separated by commas.

Example: server1.yourdomain.com,server2.yourdomain.com

PORT

The port expose to public. Default is 80. But someone said it's necessary for Railway.app detecting which port for nging.

USERNAME

Username for auth. Default is user.

PASSWORD

Password for auth. Default is password.

References

  1. Simple HTML App with NGNIX Docker container doesn't run on Railway.app - Application failed to respond (error-503)
  2. OpenSSL コマンドでサーバー上で直接 .htpasswd に ID & パスワードを追加する
  3. Workaround for Alpine-based images

About

This is for web applications running in railway.app which need a basic auth without modifing source code. You can add to railway easily by this button.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published