Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode in nginx natively #2

Open
ghost opened this issue Dec 20, 2015 · 2 comments
Open

Decode in nginx natively #2

ghost opened this issue Dec 20, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 20, 2015

For ipns.name I've looked into what's available for nginx and I think we can do the decode step completely within nginx, which I presume will make it much more robust and performant.

What do you think? I'm going to give it a try as soon as I find a bit of time.

@kyledrake
Copy link
Member

I use the set misc module on my proxy servers for re-encoding URIs, I just put this in for testing:

set_base32_alphabet abcdefghijklmnopqrstuvwxyz234567;
set_base32_padding off;
set_decode_base32 $hash $subdomain;
rewrite (/.*) https://ipfs.io/ipfs/$hash(\1);

The problem here is that this leaves you with the multihash ($hash) in binary format, and the misc module doesn't have a base58 encoder. Your options here are base32, base64, hex, or writing a base58 implementation for that module.

@ghost
Copy link
Author

ghost commented Dec 20, 2015

Mh you're right, thanks for giving it a try. What we could do though is add support for hshca in multihash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant