Instantly share code, notes, and snippets.
flobjective/reverse-proxy-kind-docker
Last active October 23, 2020 18:07- Star 0 (0) You must be signed in to star a gist
- Fork 0 (0) You must be signed in to fork a gist
-
Select an option
No results found
Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/flobjective/42a651cad8ce887abbff34fa17b2113e.js"></script> - Save flobjective/42a651cad8ce887abbff34fa17b2113e to your computer and use it in GitHub Desktop.
Select an option
No results found
Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/flobjective/42a651cad8ce887abbff34fa17b2113e.js"></script> Save flobjective/42a651cad8ce887abbff34fa17b2113e to your computer and use it in GitHub Desktop. Download ZIP Raw reverse-proxy-kind-docker This file contains hidden or 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 Show hidden characters| docker network create kind | |
| docker network connect kind <your-kind-control-plane> | |
| docker run -d --name proxy-nginx --network kind -p 80:9000 nginx | |
| docker exec proxy-nginx rm /etc/nginx/conf.d/default.conf | |
| cat >my_conf.conf <<EOL | |
| server | |
| { | |
| listen 9000; | |
| location / { | |
| proxy_pass http://<your-kind-control-plane>:9000; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection 'upgrade'; | |
| proxy_set_header Host $host; | |
| proxy_cache_bypass $http_upgrade; | |
| } | |
| } | |
| EOL | |
| docker cp my_conf.conf proxy-nginx:/etc/nginx/conf.d/my_conf.conf | |
| docker restart proxy-nginx |