Skip to content

Instantly share code, notes, and snippets.

@MHM5000
Forked from roman01la/nginx.conf
Created April 8, 2019 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MHM5000/8b487e839d5cd6285ed7e23fd7f96d4c to your computer and use it in GitHub Desktop.
Save MHM5000/8b487e839d5cd6285ed7e23fd7f96d4c to your computer and use it in GitHub Desktop.
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