Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.