diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 1b9cdfc51..2591086ac 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -38,6 +38,26 @@ server { try_files $uri @laravels; } + location ~* \.(jpe?g|png|gif|webp|svg|ico|bmp)$ { + add_header Access-Control-Allow-Origin "http://localhost:2222" always; + add_header Access-Control-Allow-Methods "GET, OPTIONS" always; + add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization" always; + add_header Access-Control-Allow-Credentials "true" always; + + if ($request_method = 'OPTIONS') { + add_header Access-Control-Allow-Origin "http://localhost:2222"; + add_header Access-Control-Allow-Methods "GET, OPTIONS"; + add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"; + add_header Access-Control-Allow-Credentials "true"; + add_header Access-Control-Max-Age 1728000; + add_header Content-Type "text/plain; charset=utf-8"; + add_header Content-Length 0; + return 204; + } + + try_files $uri @laravels; + } + location ~ \.well-known{ allow all; }