Skip to content

Instantly share code, notes, and snippets.

@mongrelion
Created May 24, 2017 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mongrelion/d3872287f1e388069df58d674ac5049c to your computer and use it in GitHub Desktop.
Save mongrelion/d3872287f1e388069df58d674ac5049c to your computer and use it in GitHub Desktop.
Nginx configuration for exposing Kubernetes running inside minikube to an external network
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
}
@wspresto
Copy link

doesn't work

@mongrelion
Copy link
Author

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment