Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #95 from ipfs/gateway-refs
Browse files Browse the repository at this point in the history
gateway: add /refs/*
  • Loading branch information
Lars Gierth committed Nov 9, 2015
2 parents 3f54b4b + 97e88ed commit 6142fb0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions solarnet/roles/ipfs_gateway/templates/nginx_ipfs_gateway.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,22 @@ server {

resolver 8.8.8.8 8.8.4.4;

set $hosturi $host$uri;
set $proxyhost "";
if ($hosturi !~ "^(h\.)?ipfs\.io/(ipfs|ipns|api)(/|$)") {
set $proxyhost $host;
location /refs/ {
rewrite "^/refs(/.*)$" $1 break;
proxy_set_header Host refs.ipfs.io;
proxy_pass http://gateway;
proxy_read_timeout 1800s;
}

location ~ "^/(ipfs|ipns|api)(/|$)" {
proxy_set_header Host "";
proxy_pass http://gateway;
proxy_read_timeout 1800s;
}

location / {
proxy_set_header Host $host;
proxy_pass http://gateway;
proxy_set_header Host $proxyhost;
proxy_read_timeout 1800s;
}

Expand Down

0 comments on commit 6142fb0

Please sign in to comment.