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

index.php doesn't work with Nginx #1479

Closed
3 tasks done
TheAntimist opened this issue May 18, 2017 · 3 comments
Closed
3 tasks done

index.php doesn't work with Nginx #1479

TheAntimist opened this issue May 18, 2017 · 3 comments
Assignees
Milestone

Comments

@TheAntimist
Copy link

TheAntimist commented May 18, 2017

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

How familiar are you with the codebase?:
1


Okay, so this is very specific to nginx, I'm not sure if anyone else has even bothered but, the /var/www/html/pihole/index.php doesn't work correctly with nginx. Minor issue, but the blocked website's name is the name of my nginx server name specified in my /etc/nginx/sites-enable/site . Though this works fine on lighttpd.

I currently use: nginx 1.10.3 with php 7.0.16-3

[BUG] Expected Behaviour:
When I open a blocked website, it gives me the following output:

    Access to the following site has been blocked:
         NGINX_CONFIG_SERVER_NAME

[BUG] Actual Behaviour:
It's supposed to be:

    Access to the following site has been blocked:
         BLOCKED_WEBSITE.NAME

I went digging around the code base a bit, not sure if it's an nginx or the php issue but this line here:

$serverName = escapeshellcmd($_SERVER['SERVER_NAME']);

should be changed to:

$serverName = escapeshellcmd($_SERVER['HTTP_HOST']);

This also works on lighttpd.


Also, just mentioning that the index.php, gives me an error in the Firefox 54.0 beta 6, though it works on Chrome, must be a beta thing.
This template was created based on the work of udemy-dl.

@WaLLy3K WaLLy3K mentioned this issue May 18, 2017
5 tasks
@WaLLy3K
Copy link
Contributor

WaLLy3K commented May 18, 2017

Thanks for the report @TheAntimist, I'll be sure to look into this further!

@WaLLy3K WaLLy3K self-assigned this May 18, 2017
@TheAntimist
Copy link
Author

TheAntimist commented May 18, 2017 via email

@WaLLy3K
Copy link
Contributor

WaLLy3K commented Oct 9, 2017

Issue will be fixed on next release.

Thanks again for bringing this to our attention! 😀

@WaLLy3K WaLLy3K added this to the v3.2 milestone Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants