From 2de0d56a443bfd0676d4c1e5763c40eb808730e1 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 11 Jun 2024 22:24:34 +0200 Subject: [PATCH] Add $host variable for fastcgi_params et proxy_params --- wo/cli/plugins/stack_pref.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 4d37d01..64d692c 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -149,6 +149,19 @@ def post_pref(self, apt_packages, packages, upgrade=False): encoding='utf-8', mode='a') as wo_nginx: wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME ' '\t$request_filename;\n') + if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params', + 'HTTP_HOST'): + WOFileUtils.textappend(self, '/etc/nginx/fastcgi_params', + '# Fix for HTTP/3 QUIC HTTP_HOST\n' + 'fastcgi_param \tHTTP_HOST \t$host;\n') + if not WOFileUtils.grep(self, '/etc/nginx/proxy_params', + 'X-Forwarded-Host'): + WOFileUtils.textappend(self, '/etc/nginx/proxy_params', + 'proxy_set_header \tX-Forwarded-Host \t$host;\n') + if not WOFileUtils.grep(self, '/etc/nginx/proxy_params', + 'X-Forwarded-Port'): + WOFileUtils.textappend(self, '/etc/nginx/proxy_params', + 'proxy_set_header \tX-Forwarded-Port \t$server_port;\n') try: data = dict(php="9000", debug="9001", php7="9070", debug7="9170",