-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ood-portal-generator should allow for different servername and redirect rules #73
Comments
The portion of the template that uses ondemand/ood-portal-generator/templates/ood-portal.conf.erb Lines 49 to 74 in cda8300
So if servername is "proxyhostname" you get: # Redirect all http traffic to the https Open OnDemand portal URI
# http://*:443
# #=> https://proxyhostname:443
#
<VirtualHost *:80>
RewriteEngine On
RewriteRule ^(.*) https://proxyhostname:443$1 [R=301,NE,L]
</VirtualHost>
# The Open OnDemand portal VirtualHost
#
<VirtualHost *:443>
ServerName proxyhostname
ErrorLog "logs/proxyhostname_error_ssl.log"
CustomLog "logs/proxyhostname_access_ssl.log" combined
RewriteEngine On
# The Open OnDemand portal VirtualHost
#
<VirtualHost *:443>
ServerName proxyhostname
ErrorLog "logs/proxyhostname_error_ssl.log"
CustomLog "logs/proxyhostname_access_ssl.log" combined
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(proxyhostname(:443)?)?$ [NC]
RewriteRule ^(.*) https://proxyhostname:443$1 [R=301,NE,L] What would the name of the second option be called, and what would it affect? How would above output look different? |
@ericfranz I made a PR for this (#74) #
<VirtualHost *:80>
RewriteEngine On
RewriteRule ^(.*) https://proxyhostname:443$1 [R=301,NE,L]
</VirtualHost>
<VirtualHost *:443>
ServerName servername
ErrorLog "logs/servername_error_ssl.log"
CustomLog "logs/servername_access_ssl.log" combined
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(proxyhostname(:443)?)?$ [NC]
RewriteRule ^(.*) https://proxyhostname:443$1 [R=301,NE,L] |
this enables us to have 1 proxy host and several backend portals, but all served from one URL. |
We have a setup with ondemand behind an loadbalancer and proxy host.
The only way (I found) to make all the redirects generated by ood-portal-generator work (as in, point to the proxy) is to set the
servername: proxyhostname
in/etc/ood/config/ood-portal.yml
.But this also sets the servername in the apache virtualhost to the proxyhost:
Which creates the problem that apache warns that the ServerName and the name in the certificate for the host are different, and there is no valid SSL.
So I think it would be good to have an separate option in
/etc/ood/config/ood-portal.yml
to set the redirects.The text was updated successfully, but these errors were encountered: