[BUG] CORS Preflight OPTIONS Requests Fail with 405 from Platform's Nginx Proxy #2454
Unanswered
JoseArias00
asked this question in
Q&A
Replies: 2 comments
-
@JoseArias00 traefik is just a go binary, there is no nginx inside of it |
Beta Was this translation helpful? Give feedback.
0 replies
-
As you mentioned @djsisson, we don't really use nginx anywhere. I don't know if your domain is being intercepted by some other service (it's happened to me), but I advise you to check where the domain is and disable any proxies in your DNS manager. I don't think there's anything to fix here other than checking your services thoroughly. I'll transfer this to the discussions section in case you need further help. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
To Reproduce
mcr.microsoft.com/dotnet/aspnet:8.0
).POST
request withContent-Type: application/json
to the backend, which triggers a preflightOPTIONS
request.Current vs. Expected behavior
Current behavior:
The browser's preflight
OPTIONS
request fails with a405 Not Allowed
status. TheServer
response header is consistentlynginx/1.29.0
. The Traefik middleware for CORS appears to be completely bypassed, and the request never reaches the application container.Expected behavior:
The Traefik middleware should intercept the
OPTIONS
request, respond with a204 No Content
status and the correctAccess-Control-*
headers. This should allow the browser's subsequentPOST
request to proceed to the backend service.Provide environment information
Which area(s) are affected? (Select all that apply)
Traefik
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
Hello team. After extensive debugging, we can confirm the issue is not within the user-deployed application container but seems to be at the platform's ingress level.
Key Findings:
The issue is not an internal Nginx proxy. We initially used a custom
Dockerfile
with Nginx. We proved via runtime logs (cat /etc/nginx/conf.d/default.conf
) that the correctnginx.conf
file (with CORS rules) was present in the container at runtime, but its directives were being ignored. We have since switched to a minimal ASP.NET base image with no Nginx inside, and the problem persists.The Traefik configuration is correct but is being bypassed. The
Server: nginx/1.29.0
header is the smoking gun. Even with no Nginx in my stack, this header is present in the 405 response. This strongly suggests there is a mandatory, global Nginx proxy in front of the user-configured Traefik router that is blockingOPTIONS
requests.Configuration that Fails
Here is the simplified, correct configuration that still results in the error.
Dockerfile
:Traefik YAML Configuration:
Could you please investigate the platform's ingress configuration? Thank you!
Will you send a PR to fix it?
Maybe, need help
Beta Was this translation helpful? Give feedback.
All reactions