Serving dynamically generated files

Gregorio Hernández Caso gregoriohc at
Mon Feb 13 17:42:18 UTC 2012

Hi everybody,

I'm trying to serve dynamically generated TXT files using PHP through
fastcgi_pass, but I have a problem that I can't solve.
This is what I have done:

   - The TXT files are going to be used by a "GPRS printer" that read them
   from an url (ex: http://server/1234.txt)
   - I have configured Nginx to rewrite the request of this files to a PHP
   - The PHP script returns the TXT contents and the same headers as for an
   static TXT file
   - If a load the URL on a browser, the content and the headers are fine.
   In fact, if I create the static TXT file with the same content of the PHP
   generated, my browser shows me exactly the same.

My problem is that the "printer" is not reading the TXT file correctly.
I know that the "printer" is working, because of two things:

   - If a create the static 1234.txt file, the "printer" prints it correctly
   - When the printer reads the dynamically generated TXT file, the PHP
   scripts also sends me an email, so I'm sure that the printer is connecting
   to the URL.

So, my question is... ¿is there any difference of how Nginx serves static
files towards dynamically generated ones?

I've researched through internet and I cannot find an answer :-(

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list