Commit 92b23663 authored by omega8cc's avatar omega8cc

Nginx: Use reliable source for db_port to write in the vhost

The $db_port can be empty if weird things happen to context on the fly, because it is a server and not site specific variable, thus $this->server->db_port should be used directly here.
parent 1ec51849
......@@ -41,7 +41,7 @@ server {
fastcgi_param db_user <?php print urlencode($db_user); ?>;
fastcgi_param db_passwd <?php print urlencode($db_passwd); ?>;
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param db_port <?php print urlencode($this->server->db_port); ?>;
listen <?php print "{$ip_address}:{$http_ssl_port}"; ?>;
server_name <?php
// this is the main vhost, so we need to put the redirection
......
......@@ -212,7 +212,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_user <?php print urlencode($db_user); ?>;
fastcgi_param db_passwd <?php print urlencode($db_passwd); ?>;
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param db_port <?php print urlencode($this->server->db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir; ?>.$host;
fastcgi_param RAW_HOST $host;
......@@ -605,7 +605,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_user <?php print urlencode($db_user); ?>;
fastcgi_param db_passwd <?php print urlencode($db_passwd); ?>;
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param db_port <?php print urlencode($this->server->db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir; ?>.$host;
fastcgi_param RAW_HOST $host;
......@@ -791,7 +791,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_user <?php print urlencode($db_user); ?>;
fastcgi_param db_passwd <?php print urlencode($db_passwd); ?>;
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param db_port <?php print urlencode($this->server->db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir; ?>.$host;
fastcgi_param RAW_HOST $host;
......@@ -867,7 +867,7 @@ location ^~ /<?php print $subdir; ?> {
fastcgi_param db_user <?php print urlencode($db_user); ?>;
fastcgi_param db_passwd <?php print urlencode($db_passwd); ?>;
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param db_port <?php print urlencode($this->server->db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir; ?>.$host;
fastcgi_param RAW_HOST $host;
......@@ -1011,7 +1011,7 @@ location @allowupdate_<?php print $subdir; ?> {
fastcgi_param db_user <?php print urlencode($db_user); ?>;
fastcgi_param db_passwd <?php print urlencode($db_passwd); ?>;
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param db_port <?php print urlencode($this->server->db_port); ?>;
fastcgi_param HTTP_HOST <?php print $subdir; ?>.$host;
fastcgi_param RAW_HOST $host;
......
......@@ -32,7 +32,7 @@ server {
fastcgi_param db_user <?php print urlencode($db_user); ?>;
fastcgi_param db_passwd <?php print urlencode($db_passwd); ?>;
fastcgi_param db_host <?php print urlencode($db_host); ?>;
fastcgi_param db_port <?php print urlencode($db_port); ?>;
fastcgi_param db_port <?php print urlencode($this->server->db_port); ?>;
listen *:<?php print $http_port; ?>;
server_name <?php
// this is the main vhost, so we need to put the redirection
......
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