Traefik 2.5 CORS issue with 3 services (fe and api, mysql)

Hello Team.

I hope you are doing well.

I have Traefik with EntryPoint 80 and 443. and behind 3 services. I am using also docker-compose.
FE and API have nginx inside of the container.
In front we have react and in API is configured to let all headers, also nginx is configured to handle CORS too. I don't have any idea how to resolve this. Also this is my second project with Traefik, first with multiple services which needs to talk. Please see attached screenshot


If I try postman I can get token from API, but in firefox I get error.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘, *’).

nginx config

if ($request_method = 'OPTIONS') {
        return 204;

    add_header 'Access-Control-Allow-Origin' '*' always;
    add_header 'Access-Control-Allow-Methods' '*' always;
    add_header 'Access-Control-Allow-Headers' '*' always;
    add_header 'Access-Control-Max-Age' 1728000;
    add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;

Backend-traefik :

container_name: something-backend
image: git something-backend-backend:production
restart: unless-stopped
- something-network

  - "traefik.enable=true"
  - "traefik.http.routers.backend.rule=Host(`api.`)"
  - "traefik.http.routers.backend.service=backend"
  - ""
  - "traefik.http.routers.backend.entrypoints=web"
  - "traefik.http.middlewares.backend.headers.accesscontrolalloworiginlist=*" 
  - "traefik.http.routers.service.middlewares=viewsheaders"
  - "traefik.http.middlewares.backend.headers.accesscontrolallowmethods=GET,OPTIONS,PUT"
  - "traefik.http.middlewares.backend.headers.accessControlExposeHeaders=*"

Thank you in advance.

Hello Team,

I would like to ask for assistance, as I tried multiple ideas but didn't work. :frowning:
I am missing something in configuration ?