Skip to content

Comment on Serving static files with Django and AWS - going fast on a budgetparent

Comments

I've heard great things about nginx. In relation to this article, how would you implement the lua script presented in this article with nginx? I know that Perl can be embedded in the server, but I'm not sure if that would be the proper solution for deciding which files to serve statically and which to serve dynamically at the httpserver level.

you probably don't need perl for that. afaics from the snippet, it fits into nginx mod_rewrite. maybe something like this:

if ($http_cookie ~* "auth=1" ) { proxy_pass http://backend ; break ; }

if (!-f $request_filename) { proxy_pass http://backend ; break ; }

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.