-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 every second time #1081
Comments
Hi, I'd like to keep Github issues for actionable bug reports or feature requests. Please ask questions in the Q&A Group. Thanks! |
I'm experiencing this bug on work software using this. Ubuntu 18.04 (fully patched) 64-bit (output of
Docker version (from
Docker-compose version (from
|
@Lewiscowles1986 This is probably because you are having two different services behind the proxy. Or the code is not deployed on one of the services (if the services behind proxy are the same). |
I'm so sorry I forgot to update this. Yes it was a documentation issue. I'd been telling new starters at work but must have forgotten posting the issue. There was a test and local version of a container running asking for the same hostname and port and that was causing issues. |
I am experiencing this same issue. I have a python http service behind the proxy AND a few APACHE2 web servers. When making requests to apache, everything works as expected. However, on the Python server container, every other request returns a 404. The logs from nginx-proxy container show the 200/404, 200/404 pattern. uname -a: docker -v: |
Are there other ports bound to the same as the python application? |
no. the python server only exposes port 8080 docker-compose logs nginx-proxy shows the alternating errors: (virtual host and IP addresses masked in this output)
|
I found something interesting: I see:
It appears that nginx is round-robin cycling thru these two servers. Only the first one is actually serving files. the second one fails with a 404. Why is the second entry there? How do I remove it? |
if I MANUALLY edit the default.conf file and remove the second server entry, everything works as expected. |
Got such problem with 404/200 alternation. Now it's resolved and I assume that my problem was in making For nginx-proxy/acme I did As for other projects, I wanted to not mix external connection with inner cross-container routing. Since Today bumped into 404/200 with docker compose, where I had Have made out lots tweaking, but ended up actually fixing that after launching nginx-proxy / acme-companion with pre-defined network. Here's how it looks: Create network with:
How I launch nginx-proxy/acme (from control script here): command="/usr/bin/docker run \
--rm \
--detach \
--name nginx-proxy \
--publish 80:80 \
--publish 443:443 \
--net inbound \
--volume $(pwd)/log:/log \
--volume certs:/etc/nginx/certs \
--volume vhost:/etc/nginx/vhost.d \
--volume html:/usr/share/nginx/html \
--volume /var/run/docker.sock:/tmp/docker.sock:ro \
nginxproxy/nginx-proxy:1.0"
command="/usr/bin/docker run \
--rm \
--detach \
--name nginx-proxy-acme \
--net inbound \
--volumes-from nginx-proxy \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
--volume acme:/etc/acme.sh \
--env \"DEFAULT_EMAIL=${CERTIFICATE_EMAIL}\" \
nginxproxy/acme-companion:2.2" Part of docker-compose from recent project:
❗ |
I have to containers with two services running (one on each container) on port 8080, mapped to two different pots on the host machine.
I am getting a HTTP 404 error after each successful load (HTTP 200) for the same service:
But, this does not happen if I call two different services (HTTP 200, but 404 if I repeat the call):
This happens when I use curl. When I use browser, it is the opposite – I get 200 every time I reload the same service, but if I change the service I get 404 for the first time, and 200 for all the consecutive reloads.
I would appreciate if someone could explain this issue? Thanks in advance!
The text was updated successfully, but these errors were encountered: