Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Node.js Express Nginx
server {
listen 80;
location / {
location ~ ^/(images/|scripts/|styles/|robots.txt|humans.txt|favicon.ico) {
root /your/app/public/folder;
access_log off;
expires max;
/* Turn off Express static middleware, get rid of this line */
server.use(express.static(path.join(__dirname, 'public')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.