I’m new to Hugo but I was able to migrate my WordPress blog over in about 3 days, everything is perfect, except I build a docker image and run my blog inside of a k8s cluster and everything works until I click on a tag, for some reason I get a redirect 301 whenever I visit /tags/ is there something special there? My Dockerfile is below so what happens is when you click on a tag you get a 301 to url:5000/tags/ instead of url/tags/ I’ve looked in the generated html to see if there is a redirect directive but it’s not there; so as a work around I am using the npm package serve which runs on port 5000 and everything is fine, I will assume serve works because it’s a “dumb” web server?? but nginx is seeing something that makes it do a redirect?? also this same behavior shows up if I just run a docker container on my host system with the below params; again everything works except for /tags it does a 301 redirect to url:port/tags/
FROM local/nginx-unprivileged:1.18.0
LABEL maintainer="Fabian Brash"
WORKDIR /usr/share/nginx/html
COPY public/ .
# RUN as non-root
USER 1000
EXPOSE 5000
CMD ["nginx", "-g", "daemon off;"]
Docker command:
docker run -d --name c1 -p 80:5000 imagename
but of course this works
docker run -d --name c1 -p 5000:5000 imagename