diff --git a/package_linter.py b/package_linter.py index 546a1e0..2eea6f1 100755 --- a/package_linter.py +++ b/package_linter.py @@ -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!" ) + @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() def nginx_https_redirect(self):