Commit a3653a1f authored by omega8cc's avatar omega8cc

Nginx: Avoid redirect loops.

parent 0ef786c3
......@@ -62,10 +62,13 @@ if ($this->redirection || $ssl_redirection) {
// redirect all aliases + main uri to the main https uri.
print "\n rewrite ^ https://{$this->uri}\$request_uri? permanent;\n";
}
elseif (!$ssl_redirection && $this->redirection) {
elseif (!$ssl_redirection && $this->redirection && $this->redirection != $this->uri) {
// Redirect all aliases to the main http url.
print "\n rewrite ^ http://{$this->redirection}\$request_uri? permanent;\n";
}
else {
print " include " . $server->include_path . "/nginx_vhost_common.conf;\n";
}
}
else {
print " include " . $server->include_path . "/nginx_vhost_common.conf;\n";
......
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