Skip to content

rewrite_to_https doesn't use different SSL port numbers correctly (fix included) #477

@binary1230

Description

@binary1230

rewrite_to_https, if using the default port of 443, works fine.

if not using 443, it doesn't work because the line that puppet generates doesn't include the custom port number.

The fix is here in templates/vhost/vhost_header.rb:

change this:

  if ($ssl_protocol = "") {
       return 301 https://$host$request_uri;
  }

to this:

  if ($ssl_protocol = "") {
    return 301 https://$host<%if @ssl_port != 443%>:<%= @ssl_port %><% end %>$request_uri;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions