nginx: complain about using $http_host rather than $host

This commit is contained in:
Alexandre Aubin 2023-07-04 15:33:02 +02:00
parent 50a325d27a
commit 6a5c346ecd

View file

@ -1295,6 +1295,16 @@ class Configurations(TestSuite):
"DO NOT run the app PHP worker as root or www-data! Use a dedicated system user for this app!" "DO NOT run the app PHP worker as root or www-data! Use a dedicated system user for this app!"
) )
@test()
def nginx_http_host(self):
app = self.app
if os.path.exists(app.path + "/conf/nginx.conf"):
content = open(app.path + "/conf/nginx.conf").read()
if "$http_host" in content:
yield Info("In nginx.conf : please don't use $http_host but $host instead. C.f. https://github.com/yandex/gixy/blob/master/docs/en/plugins/hostspoofing.md")
@test() @test()
def nginx_https_redirect(self): def nginx_https_redirect(self):