Is nginx suited for serving PDFs?

Solution 1:

When in doubt, benchmark! Fortunately someone else has already done this:

http://nbonvin.wordpress.com/2011/03/24/serving-small-static-files-which-server-to-use/

Conclusion? Allow me to quote:

G-WAN seems again to perform a lot better than the other servers. Nginx always performs slightly better than Lighttpd, while Apache Traffic server is very similar to Lighttpd in term of performance.

And:

Regarding the resources used by each server, Nginx is the winner in term of memory usage, as the amount of memory does not increases with the number of concurrent clients. G-WAN requires 2 times less CPU than the other servers.

The proof is in the numbers. Nginx is second best at requests/second, average for cpu usage, and best for memory usage. So yes, nginx is definitely a good server for statically serving standard size PDFS.

Solution 2:

There is nothing to prove, nginx is specifically optimized for serving static content.

You were told wrong.

Solution 3:

The typical use for nginx is to serve the static files for a web site, while something else (which nginx proxies to) serves the dynamic content. Unless you're generating the PDFs on the fly, nginx should be perfectly fine.