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

allow usage of express' 'trust proxy' to use reverse proxy for parse … #13

Merged
merged 1 commit into from
Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ parse-server:
ALLOW_CLIENT_CLASS_CREATION: $ALLOW_CLIENT_CLASS_CREATION # true
APP_NAME: $APP_NAME
PUBLIC_SERVER_URL: $PUBLIC_SERVER_URL
# ...
TRUST_PROXY: $TRUST_PROXY # false
# ...
```

Remote parse-cloud-code image:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ parse-server:
ALLOW_CLIENT_CLASS_CREATION: $ALLOW_CLIENT_CLASS_CREATION # true
APP_NAME: $APP_NAME
PUBLIC_SERVER_URL: $PUBLIC_SERVER_URL
links:
TRUST_PROXY: $TRUST_PROXY
links:
- mongo
volumes_from:
- parse-cloud-code
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ var api = new ParseServer({

var app = express();

if(process.env.TRUST_PROXY == 1) {
console.log("trusting proxy");
app.enable('trust proxy');
}

// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"nodemon": "^1.8.1",
"docker-links": "^1.0.2",
"express": "~4.2.x",
"express": "~4.13.x",
"kerberos": "~0.0.x",
"parse": "~1.6.12",
"parse-server": "~2.1.4"
Expand Down