Created
May 24, 2017 07:58
-
-
Save mongrelion/d3872287f1e388069df58d674ac5049c to your computer and use it in GitHub Desktop.
Nginx configuration for exposing Kubernetes running inside minikube to an external network
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
events { | |
worker_connections 1024; | |
} | |
http { | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
include /usr/local/etc/nginx/mime.types; | |
default_type application/octet-stream; | |
access_log /usr/local/var/log/nginx/access.log; | |
error_log /usr/local/var/log/nginx/error.log; | |
# include /usr/local/etc/nginx/conf.d/*.conf; | |
# Minikube proxy configuration | |
upstream minikube { | |
server 192.168.99.100:8443; # Internal IP:port where minikube & k8s cluster is listening on | |
} | |
server { | |
listen 172.16.175.86:8443 default_server; # IP of the host network and the port where incoming connections to k8s will be coming to | |
server_name deathstar; # hostname of the host machine | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://minikube; | |
} | |
} | |
# End - Minikube proxy configuration | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
doesn't work