아 nginx-fastapi CORS 어떻게 뚫었는지 좀 알려달라고 ㅠㅠ

난 사이에 nginx - gunicorn(worker로 uvicornWorker 씀) - fastapi 이렇게 되고 있는데

nginx에서


server {

listen 80;

server_name xxx.xxx.xxx.xxx;

location / {

add_header 'Access-Control-Allow-Origin' '*';

include proxy_params;

proxy_pass http://127.0.0.1:8000;

}

}


파이썬에서


from fastapi.middleware.cors import CORSMiddleware


origins = ["*"]

app.add_middleware(

CORSMiddleware,

allow_origins=origins,

allow_credentials=True,

allow_methods=["*"],

allow_headers=["*"],

)


이렇게 해놨는데 여전히 CORS 로 걸린다 ㅠㅠ