Skip to content

Instantly share code, notes, and snippets.

@rvargs
Forked from amb101/gist0.js
Created July 5, 2023 20:05
Show Gist options
  • Save rvargs/c4acd75f5a48e045072a5f5e370215c4 to your computer and use it in GitHub Desktop.
Save rvargs/c4acd75f5a48e045072a5f5e370215c4 to your computer and use it in GitHub Desktop.
Nginx / Node Frontend / Load Balancer / Static Assets Caching
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
proxy_pass http://project;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 168h;
}
location /api {
expires 10m;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment