Use Netlify as HTTPS proxy for Storj decentralized Object Storage

Hi everybody!
I am currently hosting my personal website at I am placing inside the original website repository the few media files that go with it, and they amount to some 100MB.

Both to reduce the heaviness of my website repository, keeping it shy of media files, but above all to have a future-proof convenient LFS solution, I intend to serve bigger files through Storj Object Storage, that is awesome. Nevertheless, in Storj’s guide to host a static website (hence to host media files, too), it points out that a proxy server is required in order to ensure HTTPS connection:

  1. Without further action, your site will be served with HTTP. You can secure your site by using an HTTPS proxy server such as Fastly.

Is there any way Netlify could help me with this?
Rather than having to rely on a complex system of proxies or serving resources through HTTP, I would stick with my current solution, but I really would prefer to implement Storj.

Any suggestion would be extremely helpful. Please bear in mind that unfortunately I am not a developer, and I could not, for instance, develop a plugin to carry out this task.

Thanks a lot!

It can be achieved with Netlify rewrites:

Basically, a rewrite rule like:

/storage/* 200! would do the trick.

1 Like

Thanks a lot, @hrishikesh, this is awesome and super useful! Can I ask you where should I write the redirect rule in?

Furthermore, is there a way I can redirect any resource URL to the root of my domain, regardless of the subdirectory they originally were in?

e.g. I would like to have and respectively available as and

Would it be possible?

Sorry, some further problem… I both tried adding a _redirects file with this content

#/* 200!
/audio/* 200!
/fonts/* 200!
/graphics/* 200!
/images/* 200!
/svg/* 200!
/video/* 200!

and a netlify.toml with:

	from	= '/assets/*'
	to		= ''
	status	= 200
	force	= true

In both cases, nothing works… you could reproduce the error with the file

Ok, so apparently the error lied in the ', TOML files only accept ".
It now works!

Sorry if I ask for more, but could you tell me how I can cache the assets properly?

By running a test, as you can see here, I should be able to cache the files served via 200

Could you help me, @hrishikesh? If needed I could create a new thread.

Hey @tommi,

To cache files, the appropriate cache control headers need to be sent by the destination server. We respect those headers and cache accordingly. If you cannot control the caching headers on the destination server, there’s not a lot you can do.