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

GridStoreAdapter files location #1131

Closed
davimacedo opened this issue Mar 22, 2016 · 5 comments · Fixed by #1287
Closed

GridStoreAdapter files location #1131

davimacedo opened this issue Mar 22, 2016 · 5 comments · Fixed by #1287

Comments

@davimacedo
Copy link
Member

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.

@flovilmart
Copy link
Contributor

@davimacedo would you set a publicServerURL, and use that as the base? Would that provide a proper fix for you?

@davimacedo
Copy link
Member Author

@flovilmart I will try today and revert to you. thanks.

@seijiakiyama
Copy link
Contributor

@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 #1131 (comment).
We're willing to contribute about it.

@justinmfischer
Copy link

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'),
...
});

@flovilmart
Copy link
Contributor

@seijiakiyama we're waiting on your contribution then!

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

Successfully merging a pull request may close this issue.

4 participants