I have a minikube service running on http://192.168.49.2:31746
on the server with IP address 10.128.135.6
When I curl http://192.168.49.2:31746
on the server on which Minikube is running, I can access the service. However, I want to access this service on the local network from clients also(within the local network).
I have found that I will need to set up Nginx reverse proxy for this but I am not able to get it working. Here are the steps I followed to run nginx on docker
- Made a Dockerfile
FROM nginx:latest
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8765
- Made a nginx.conf file in the same directory with contents
server {
listen 8765;
server_name 10.128.135.6;
location / {
proxy_pass http://192.168.49.2:31746;
}
}
- Built the docker image using
docker build -t my-nginx .
- Run the docker container.
docker run -p 8765:8765 -d my-nginx
what I want is when I go to the URL http://10.128.135.6:8765/hub/login
on a system in the local network, the request should go to http://192.168.49.2:31746/hub/login