Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Node.js Express Nginx
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
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.