Skip to content

Commit 918b148

Browse files
authored
Update 07_symfony_location.conf
1 parent 4258b64 commit 918b148

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎config/nginx/07_symfony_location.conf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
# Taken from https://symfony.com/doc/current/setup/web_server_configuration.html#nginx
44

55
location / {
6-
# try to serve file directly, fallback to index.php
7-
try_files $uri /index.php$is_args$args;
6+
7+
if ($request_method = 'OPTIONS') {
8+
include /usr/local/turbolab.it/webstackup/config/nginx/cors.conf;
9+
return 204;
10+
}
11+
12+
# try to serve file directly, fallback to index.php
13+
try_files $uri /index.php$is_args$args;
814
}
915

1016
## WebDebugToolbar stylesheet (dev only)
@@ -20,6 +26,12 @@ location ^~ /_wdt/ {
2026
# }
2127

2228
location ~ ^/(index|autodeploy|autodeploy-async|async-runner-request)\.php(/|$) {
29+
30+
if ($request_method = 'OPTIONS') {
31+
include /usr/local/turbolab.it/webstackup/config/nginx/cors.conf;
32+
return 204;
33+
}
34+
2335
fastcgi_pass unix:/run/php/php$PHP_VER-fpm.sock;
2436
fastcgi_split_path_info ^(.+\.php)(/.*)$;
2537
include fastcgi_params;

0 commit comments

Comments
 (0)