Skip to content

Commit

Permalink
Clean up nginx rules for content caching (#4343)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmanjunath committed Nov 14, 2022
1 parent d4ee172 commit bfc5903
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions creator-node/nginx_conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,13 @@ http {
# Match the paths /ipfs/<cid: string> and /content/<cid: string>.
# If present in cache, serve. Else, hit upstream server + update cache + serve.
# http://nginx.org/en/docs/http/ngx_http_core_module.html#location
location ~ (/ipfs/|/content/|/file_lookup/) {
location ~ (/ipfs/|/content/) {
proxy_cache cache;
proxy_pass http://127.0.0.1:3000;

# Set client IP as `X-Forwarded-For` response header
proxy_set_header X-Forwarded-For $remote_addr;

# proxy_cache_use_stale + proxy_cache_background_update -> deliver stale content when client requests
# an item that is expired or in the process of being updated from origin server
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_background_update on;

# Cache responses with certain status codes for some duration before considered stale.
# Stale implies content will be fetched from the upstream server. Stale content WILL NOT
# BE REMOVED from the cache.
Expand Down

0 comments on commit bfc5903

Please sign in to comment.