This commit is contained in:
LORENZO\pacio 2025-09-26 18:11:07 +02:00
parent 2c5e66c4f7
commit 9235a52e9d
2 changed files with 25 additions and 1 deletions

View File

@ -11,7 +11,8 @@ ALLOWED_ORIGINS = [
"http://192.168.10.94/",
"http://192.168.10.94:8080/",
"http://localhost:8080",
"http://localhost"
"http://localhost",
"http://172.17.0.1:38500"
]
app.add_middleware(

23
nginx.conf Normal file
View File

@ -0,0 +1,23 @@
location /coditech/ {
proxy_pass http://127.0.0.1:38500/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# CORS for public (no credentials)
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS always;
add_header Access-Control-Allow-Headers Origin,Content-Type,Accept,Authorization always;
# Preflight
if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
add_header Access-Control-Allow-Headers Origin,Content-Type,Accept,Authorization;
add_header Access-Control-Max-Age 1728000;
add_header Content-Length 0;
return 204;
}
}