For a project of mine, I needed a way to make my minikube cluster reachable over localhost:4567
, which seems to have no easy solution with basic tools. The script here basically uses the provided nginx.conf
file and proxies all the requests to your provided IP address. In my case, my minikube installation had the IP address 192.168.99.101
, which means my nginx.conf
file was like this:
server {
listen 80;
server_name localhost;
location / {
access_log off;
proxy_pass http://192.168.99.101;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
This approach can be used to proxy whatever you want to wherever you want.