-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathnginx.conf
More file actions
20 lines (18 loc) · 788 Bytes
/
nginx.conf
File metadata and controls
20 lines (18 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
server {
listen 0.0.0.0:80;
root /usr/share/nginx/html;
index index.html;
error_page 404 /404.html;
location / {
try_files $uri $uri/ /index.html =404;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; # Update to include OPTIONS method
add_header Access-Control-Allow-Headers "Authorization, Content-Type"; # Specify allowed headers
add_header Access-Control-Max-Age 86400; # Set CORS preflight request cache duration
add_header Access-Control-Allow-Credentials false;
add_header Access-Control-Expose-Headers *;
if ($request_method = 'OPTIONS') {
return 204; # Return 204 No Content for OPTIONS requests
}
}
}