Skip to content

Instantly share code, notes, and snippets.

@woss
Created April 24, 2023 09:25
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 woss/f8c9ab4aa7655ff53ae5ce5e7d780aa8 to your computer and use it in GitHub Desktop.
Save woss/f8c9ab4aa7655ff53ae5ce5e7d780aa8 to your computer and use it in GitHub Desktop.
# General purpose ipfs gateway for Macula nodes;
*.g.macula.link {
	encode gzip
	# rewrite the main request
	rewrite * /ipfs/{labels.3}{uri}

	reverse_proxy {
		# proxy all to the IPFS gateway
		to http://127.0.0.1:8080

		# catch 404, this will happen when reloading page that has memory router and the path doesn't
		# exist on the IPFS
		@not_found status 404
		handle_response @not_found {
			# remove the {uri} because that is the error
			rewrite * /ipfs/{labels.3}/index.html
			reverse_proxy http://127.0.0.1:8080
		}
	}

	log {
		output file ./logs/g.log
		level DEBUG
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment