Last active
January 25, 2021 13:52
-
-
Save sashaaro/ac1ed79ed2e45ae53e0f936be008fe13 to your computer and use it in GitHub Desktop.
simple tunnel example
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
# public server compose for foobar.com | |
services: | |
nginx: | |
image: library/nginx:1.19.6 | |
network_mode: host | |
volumes: | |
- ./conf.d:/etc/nginx/conf.d | |
- /etc/letsencrypt:/etc/letsencrypt | |
tunnel: | |
image: jpillora/chisel:latest | |
network_mode: host | |
command: "server -p 8080 --reverse" |
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
# client | |
services: | |
# any dev watcher server | |
serve: | |
image: node:14.15.4-alpine | |
entrypoint: npm | |
command: ["run", "watch"] | |
tty: true | |
ports: | |
- "3000:3000" | |
tunnel: | |
image: jpillora/chisel:latest | |
network_mode: host | |
command: "client foobar.com:8080 R:3000:3000" |
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
# conf.d/foobar.conf | |
server { | |
server_name foobar.com www.foobar.com; | |
listen *:443 ssl; | |
ssl_certificate /etc/letsencrypt/live/foobar.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/foobar.com/privkey.pem; | |
ssl_trusted_certificate /etc/letsencrypt/live/foobar.com/chain.pem; | |
location / { | |
proxy_pass http://localhost:3000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment