How do I change the ipfs/$hash path to something/$hash?

Hello guys

How the heck do I change the ipfs/$hash path to something/$hash ?

I found some info but its is very long and confusing!
ipfs/specs#152

isn4t there a config I can change for my gateway?

Maybe in the ipfs config or my nginx config?

Thank you

Do you just want your gateway to host IPFS files at http://my.gateway/something/$hash? In that case, you’ll probably need to use an nginx rule to rewrite your paths. However, all existing IPFS sites /ipfs/$hash paths by default so links may not work. You can probably work around this by adding a /ipfs/... redirect rule to your nginx config.

Could you explain why you’d like to do this? That might help us figure out a better solution.

1 Like

I want to get rid of ipfs/$hash and ipns/ paths too so they don’t access them at all

and have a secret path I can only use if needed because if somebody accesses your gateway via its raw IP address? In that case it is still possible to request arbitrary content via the gateway.

http:///ipfs/<some 4GB warezed movie>

and waste my traffic I pay for in aws and have a huge bill!

and maybe then I can use this instead of my node

https://ipfs.io/ipfs/$hash so I can download it from here without wasting my traffic ?? (is it going to download it if not pinned or copied in other nodes ?)

so in other words having that path is not a good idea may be add an ipfs config for a secret key?

like ipfs/$hash?key=somethingdifferent

but I prefer to have a custom path instead of something static like that (maybe there would be security issue and they might find I am using ipfs instead swarm or others and try to attack my node…)

but there must be an option in ipfs to disable those routes!

thank you

I still have no idea what you’re actually trying to accomplish.

1 Like

1.Block /ipfs and /ipns routes
2. change the ipfs/$hash to something/$hash
3.possible to add secret key to only get the file with it?

thanks