Last active
March 25, 2024 13:35
-
-
Save craftpip/1ee30be73d11ff53d66c0eba1906fc33 to your computer and use it in GitHub Desktop.
nginx reverse proxy config for <port>.domain.com to localhost:<port>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a default site configuration which will simply return 404, preventing | |
# chance access to any other virtualhost. | |
resolver 172.17.0.1 valid=1s; | |
server { | |
listen 80; | |
server_name ~^(?<port>\d+)\.boniface\.pe$; | |
location / { | |
set $backend_port $port; | |
proxy_pass http://host.docker.internal:$port; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for apache: