Skip to content

Commit

Permalink
redirect to HTTP_HOST to support aliases (#3508)
Browse files Browse the repository at this point in the history
redirect to http requests to HTTP_HOST to support aliases.
  • Loading branch information
johrstrom authored Apr 11, 2024
1 parent 6e627c0 commit 12375e0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ood-portal-generator/spec/fixtures/ood-portal.conf.all
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Listen 8080
ServerAlias foo.example.com

RewriteEngine On
RewriteRule ^(.*) https://test.proxy.name:8080$1 [R=301,NE,L]
RewriteRule ^(.*) https://%{HTTP_HOST}:8080$1 [R=301,NE,L]
</VirtualHost>

# The Open OnDemand portal VirtualHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
ServerName example.com

RewriteEngine On
RewriteRule ^(.*) https://example.com:443$1 [R=301,NE,L]
RewriteRule ^(.*) https://%{HTTP_HOST}:443$1 [R=301,NE,L]
</VirtualHost>

# The Open OnDemand portal VirtualHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
ServerName example.com

RewriteEngine On
RewriteRule ^(.*) https://example.com:443$1 [R=301,NE,L]
RewriteRule ^(.*) https://%{HTTP_HOST}:443$1 [R=301,NE,L]
</VirtualHost>

# The Open OnDemand portal VirtualHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
ServerName example.com

RewriteEngine On
RewriteRule ^(.*) https://example.com:443$1 [R=301,NE,L]
RewriteRule ^(.*) https://%{HTTP_HOST}:443$1 [R=301,NE,L]
</VirtualHost>

# The Open OnDemand portal VirtualHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
ServerName ondemand.example.com

RewriteEngine On
RewriteRule ^(.*) https://ondemand.example.com:443$1 [R=301,NE,L]
RewriteRule ^(.*) https://%{HTTP_HOST}:443$1 [R=301,NE,L]
</VirtualHost>

# The Open OnDemand portal VirtualHost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
ServerName example.com

RewriteEngine On
RewriteRule ^(.*) https://example-proxy.com:443$1 [R=301,NE,L]
RewriteRule ^(.*) https://%{HTTP_HOST}:443$1 [R=301,NE,L]
</VirtualHost>

# The Open OnDemand portal VirtualHost
Expand Down
2 changes: 1 addition & 1 deletion ood-portal-generator/templates/ood-portal.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Listen <%= addr_port %>
<%- end -%>

RewriteEngine On
RewriteRule ^(.*) <%= @ssl ? "https" : "http" %>://<%= @proxy_server %>:<%= @port %>$1 [R=301,NE,L]
RewriteRule ^(.*) <%= @ssl ? "https" : "http" %>://%{HTTP_HOST}:<%= @port %>$1 [R=301,NE,L]
</VirtualHost>
<% end -%>

Expand Down

0 comments on commit 12375e0

Please sign in to comment.