Commit b142dbeb authored by omega8cc's avatar omega8cc

Nginx: Set HTTP_HOST with $this->uri to avoid reverse order with multi-level subdirs

With previous configuration if the site name is set to bar.foo.example.com and alias to example.com/foo/bar it would set HTTP_HOST to foo.bar.$host while it should set it to bar.foo.example.com -- now we no longer need to worry that user will confuse the order of foo.bar bar.foo in site name with foo/bar bar/foo order in the special subdir alias
parent 2db3f3b0
......@@ -251,7 +251,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir_dot; ?>.$host;
fastcgi_param HTTP_HOST <?php print $this->uri; ?>;
fastcgi_param RAW_HOST $host;
fastcgi_param SITE_SUBDIR <?php print $subdir; ?>;
fastcgi_param MAIN_SITE_NAME <?php print $this->uri; ?>;
......@@ -714,7 +714,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir_dot; ?>.$host;
fastcgi_param HTTP_HOST <?php print $this->uri; ?>;
fastcgi_param RAW_HOST $host;
fastcgi_param SITE_SUBDIR <?php print $subdir; ?>;
fastcgi_param MAIN_SITE_NAME <?php print $this->uri; ?>;
......@@ -913,7 +913,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir_dot; ?>.$host;
fastcgi_param HTTP_HOST <?php print $this->uri; ?>;
fastcgi_param RAW_HOST $host;
fastcgi_param SITE_SUBDIR <?php print $subdir; ?>;
fastcgi_param MAIN_SITE_NAME <?php print $this->uri; ?>;
......@@ -989,7 +989,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir_dot; ?>.$host;
fastcgi_param HTTP_HOST <?php print $this->uri; ?>;
fastcgi_param RAW_HOST $host;
fastcgi_param SITE_SUBDIR <?php print $subdir; ?>;
fastcgi_param MAIN_SITE_NAME <?php print $this->uri; ?>;
......@@ -1133,7 +1133,7 @@ location @allowupdate_<?php print $subdir_loc; ?> {
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir_dot; ?>.$host;
fastcgi_param HTTP_HOST <?php print $this->uri; ?>;
fastcgi_param RAW_HOST $host;
fastcgi_param SITE_SUBDIR <?php print $subdir; ?>;
fastcgi_param MAIN_SITE_NAME <?php print $this->uri; ?>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment