Skip to content
Advertisement

nginx return 200 but empty reponse

I am currently migrating apache to nginx and I am struggling to get it working. Basically I get a 200 response with no content. My nginx configuration is as below:

JavaScript

And here is www.conf file

JavaScript

fastcgi_params

JavaScript

My URL is something like:

JavaScript

PHP files are on /build/website directory and it is primarily an API site, no static or HTML files.

Is there anything obvious I am missing?

Many thanks. Cheers, Vini

Advertisement

Answer

You don’t have the SCRIPT_FILENAME FastCGI parameter defined. Add the

JavaScript

directive to your PHP handler location block. Additionally, that location block uses the default nginx root instead of /build/website one, move the root directive to the server context.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement