worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { init_by_lua_block { require "routes" } server { listen 8080; include mime.types; charset utf-8; location / { default_type text/html; } location /foo { default_type text/html; rewrite_by_lua_block { routes = require "routes" routes:dispatch() } } location /css { expires 1h; alias css; } } }