server { root /var/www/symfony/public; location / { try_files $uri /index.php$is_args$args; } location ~ ^/index\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; fastcgi_pass php:9000; # Allow long-running exports without nginx timing out while waiting for PHP fastcgi_read_timeout 600s; add_header 'Access-Control-Allow-Origin' * always; add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, PUT, DELETE, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; } location ~ \.php$ { return 404; } location ~* \.(eot|otf|ttf|woff|woff2|ttc)$ { add_header Access-Control-Allow-Origin *; } client_max_body_size 30M; gzip on; gzip_vary on; gzip_min_length 10240; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css text/html text/xml text/javascript application/x-javascript application/xml application/json; error_log /var/log/nginx/symfony_error.log; access_log /var/log/nginx/symfony_access.log; }