appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

fix: Fix X-Forwarded-Host with multiple rev-proxies

Open sharat87 opened this issue 2 years ago • 3 comments

When there's another reverse proxy in front of Appsmith container, in addition to the NGINX that comes with Appsmith, the Forwarded host is not carried over.

Steps to reproduce

Start a new fat container with

docker run --rm -p 8001:80 -v "$PWD"/stacks-ee:/appsmith-stacks -e APPSMITH_OAUTH2_GOOGLE_CLIENT_ID="dummy-id" -e APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET="dummy-secret" -d --pull always appsmith/appsmith-ee

Now, once that is up, run the following curl command to see where the Google OAuth button would take you:

curl -sSI -H 'X-Forwarded-Host: another.com' -H 'X-Forwarded-Proto: https' http://localhost:8001/oauth2/authorization/google | grep -Eo 'redirect_uri=[^&]*'

The redirect_uri doesn't have the correct host. We expect another.com, but we see localhost.

sharat87 avatar Sep 21 '22 10:09 sharat87

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Oct 14, 2022 at 0:00AM (UTC)

vercel[bot] avatar Sep 21 '22 10:09 vercel[bot]

Fix for issue reported in https://community.appsmith.com/t/1361/11.

sharat87 avatar Sep 21 '22 10:09 sharat87

Unable to find test scripts. Please add necessary tests to the PR.

github-actions[bot] avatar Sep 21 '22 11:09 github-actions[bot]

@sharat87 : Should we request @RakshaKShetty for a quick sanity with SAML fat container with custom domain?

trishaanand avatar Sep 22 '22 06:09 trishaanand

@trishaanand, I'll apply the fix on the test instance directly and we can verify there. The test case needs a load balancer as well, otherwise we won't see the problem.

sharat87 avatar Sep 22 '22 06:09 sharat87

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Sep 29 '22 16:09 github-actions[bot]

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Oct 07 '22 16:10 github-actions[bot]

@trishaanand, I'm going to merge this after the freeze is lifted. Let's test the SAML scenario with the release Docker Image. Sound okay?

sharat87 avatar Oct 13 '22 08:10 sharat87

/ok-to-test sha=dd6376d

sharat87 avatar Oct 13 '22 23:10 sharat87

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3246362318. Workflow: Appsmith External Integration Test Workflow. Commit: dd6376d. PR: 16951. Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=16951&runId=3246362318_1

github-actions[bot] avatar Oct 13 '22 23:10 github-actions[bot]

Deployment failed with the following error:

Resource is limited - try again in 3 hours (more than 100, code: "api-deployments-free-per-day").

vercel[bot] avatar Oct 13 '22 23:10 vercel[bot]

/ok-to-test sha=6a04342

sharat87 avatar Oct 13 '22 23:10 sharat87

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3246458903. Workflow: Appsmith External Integration Test Workflow. Commit: 6a04342. PR: 16951. Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=16951&runId=3246458903_1

github-actions[bot] avatar Oct 13 '22 23:10 github-actions[bot]