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

SERVER_NAME vs HTTP_HOST in google.php #4

Open
jrblakely opened this issue Oct 28, 2022 · 0 comments
Open

SERVER_NAME vs HTTP_HOST in google.php #4

jrblakely opened this issue Oct 28, 2022 · 0 comments

Comments

@jrblakely
Copy link

I am using an NGINX web server with a regular expression to match multiple host names, and the SERVER_NAME returned is the regular expression, not the actual host name requested/used. This caused an interesting (to me) issue because Google of course did not like the regular expression as the redirect URI.

I fixed this for my site by changing this
$baseURL = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
to this
$baseURL = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

I am not sure if this is a universally wholesome change or if it introduces problems for a different configuration. Just sharing in case it is helpful to someone else.

Thanks

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

No branches or pull requests

1 participant