Context: I've got an application that run under a given domain. But in some cases I need to run it under another domain than the domain it expect (I also change potentially the port).
I'm trying to custom the fastcgi_param HTTP_HOST, but the application still receive the "real" one.
Here is what I tried as configuration:
location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass php:9000; fastcgi_index app.php; fastcgi_param SCRIPT_FILENAME /app/web$fastcgi_script_name; fastcgi_intercept_errors on; include fastcgi_params; fastcgi_param SERVER_NAME my-app.com; fastcgi_param HTTP_HOST my-app.com; }
There's many problems:
- The port is not specified in HTTP_HOST, is there a way to set only the host? (maybe a set a variable that will be use for definition of the param)
- This does not work at all, finally "my-app.com" is not transmitted; why?
Note: this is based on nginx docker image.
;clear_env = no