Commit 5c5d4e75 authored by omega8cc's avatar omega8cc

Nginx: Remove duplicate $args on redirects

We need $request_uri? and not just $request_uri in rediercts, or duplicate $args may break things.
parent 73464d57
......@@ -22,7 +22,7 @@ server {
ssl_certificate <?php print $ssl_cert; ?>;
ssl_certificate_key <?php print $ssl_cert_key; ?>;
keepalive_timeout 70;
rewrite ^ $scheme://<?php print $this->redirection; ?>$request_uri permanent;
rewrite ^ $scheme://<?php print $this->redirection; ?>$request_uri? permanent;
}
<?php endforeach; ?>
<?php endif; ?>
......
......@@ -16,7 +16,7 @@ if ($ssl_redirection || $this->redirection) {
print " server_name {$alias_url};\n";
}
print " access_log off;\n";
print " rewrite ^ \$scheme://{$this->redirection}\$request_uri permanent;\n";
print " rewrite ^ \$scheme://{$this->redirection}\$request_uri? permanent;\n";
print "}\n";
}
}
......@@ -78,11 +78,11 @@ server {
if ($this->redirection || $ssl_redirection) {
if ($ssl_redirection && !$this->redirection) {
// redirect aliases in non-ssl to the same alias on ssl.
print "\n rewrite ^ https://\$host\$request_uri permanent;\n";
print "\n rewrite ^ https://\$host\$request_uri? permanent;\n";
}
elseif ($ssl_redirection && $this->redirection) {
// redirect all aliases + main uri to the main https uri.
print "\n rewrite ^ https://{$this->redirection}\$request_uri permanent;\n";
print "\n rewrite ^ https://{$this->redirection}\$request_uri? permanent;\n";
}
elseif (!$ssl_redirection && $this->redirection) {
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