mardi 24 août 2021

Nginx with docker does not work with different port mapping

I have created a basic static website and I'm trying to deploy my site on nginx server with docker.

It works fine when I run docker run -d -p 80:80 -v /path/to/site:/usr/share/nginx/html nginx

But when I map it with different port like -p 8080:80 it gives me a bad gateway error.

The initial homepage loads up fine http://localhost:8080,but when I try to navigate in the website like a blog post, it redirects to http://localhost/blog rather than http://localhost:8080/blog. I have not changed any configuration whatsoever, I have left it default.

Initially I thought it must be with my site but it works fine with httpd & docker. But I want to run it on a nginx server.

Please help me !!




Aucun commentaire:

Enregistrer un commentaire