Skip to content

Instantly share code, notes, and snippets.

@offbyone
Created November 15, 2022 04:55
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 offbyone/510f203318d563784ebe93215899e9f6 to your computer and use it in GitHub Desktop.
Save offbyone/510f203318d563784ebe93215899e9f6 to your computer and use it in GitHub Desktop.
location ~ ^/users/([^/]+)$ {
proxy_cache static-cache;
proxy_cache_key "$scheme$host$request_uri$http_accept";
proxy_cache_valid 200 1h;
proxy_cache_valid 410 7d;
proxy_cache_valid 404 30m;
proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504;
# proxy_cache_bypass $http_x_purge; # you may not want this to mitigate potential attacks
add_header X-Cache-Status $upstream_cache_status;
proxy_pass http://127.0.0.1:3000;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
tcp_nodelay on;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment