GridStoreAdapter files location
Because of https://github.com/ParsePlatform/parse-server/blob/master/src/Adapters/Files/GridStoreAdapter.js#L66 when using nginx (or other) to proxy requests, you don't have enough control over the files location url.
My suggestion is to use like it currently is as a default behavior but add an optional parameter in the GridStoreAdapter to set the file location (instead of the default config.mount).
I would like to know if a contribution about it would be welcome.
@davimacedo would you set a publicServerURL, and use that as the base? Would that provide a proper fix for you?
@flovilmart I will try today and revert to you. thanks.
@flovilmart @davimacedo the publicServerURL didn't work here at back{4}app.
We've tested through files being shown with "http://" (They're served under both HTTP and HTTPS protocols). But we needed it to be "https://" by default. So, the problem was solved by adding the "X-Forwarded-Proto" header as "https" on nginx and adding "app.enable('trust proxy');" to our express. Then, config.mount will receive the desired protocol on req.protocol.
That solved our problem, but we still think that there could be another way to do that, just like suggested on https://github.com/ParsePlatform/parse-server/issues/1131#issuecomment-199785174. We're willing to contribute about it.
We are also behind nginx on AWS. Is it also possible to implement a custom GridStoreAdapter and configure it while creating the server? Something like this...
var gridStoreAdapter = require('parse-server'). GridStoreAdapter; var api = new ParseServer({ ... filesAdapter: new gridStoreAdapter('http://my.mount.url'), ... });
@seijiakiyama we're waiting on your contribution then!