i want to proxy an url like “https://my_ood_frontend.cluster.org/blabla/…” seen by the users into " https://my_ood_frontend.cluster.org:8443/…" by example.
I don’t think you can by editing the confg yml. We just don’t allow for arbitrary redirect rules, though maybe we should?
Most folks modify the resulting /opt/rh/httpd24/root/etc/httpd/conf.d/ood-portal.conf when they need to do something like this. But this comes at a price, those edits will not be preserved next time you reconfigure using the ood-portal-generator. So you’d have to add them back every time.
So, if you really need to do this, I’d suggest hacking the template it’s created from.
This is the file to modify: /opt/ood/ood-portal-generator/templates/ood-portal.conf.erb. Please make a back up copy before you make any modifications. If you get into trouble, just start over from ood-portal.conf.erb.backup (or whatever you name the backup file).
It’s a ruby ERB template file, but you can just add hard coded rules. Here’s the section I pulled where we’re redirecting / to /pun/sys/dashboard. Just add your items after it like so,
<%- if @root_uri -%>
# Redirect root URI to specified URI
#
# <%= @ssl ? "https" : "http" %>://<%= @servername || "localhost" %>:<%= @port %>/
# #=> <%= @ssl ? "https" : "http" %>://<%= @servername || "localhost" %>:<%= @port %><%= @root_uri %>
#
RedirectMatch ^/$ "<%= @root_uri %>"
<%- end -%>
# Here are my additional redirects modified in the template
RedirectMatch ^/blah-blah-blah$ "/yadda-yadda-yadda"
I tell if you want a redirect or a rewrite. This explanation was for a redirect, but it would be the same for rewrite like this if I wanted to get rid of the /pun/sys bit of the url for my super cool app.
# Here are my additional redirects & rewrites modified in the template
RedirectMatch ^/blah-blah-blah$ "/yadda-yadda-yadda"
RewriteRule ^/pun/sys/super-cool-app$ "/super-cool-app"
Just be careful next time you upgrade, at the very least we’ll replace the file outright in an upgrade, so keep a backup in a second location (or in source control). At the very most we’d add things to it so you would have to merge your changes into the new file as you update.
Sorry for my poor english writing. i wanted to say : “i have replaced the 1st rule by a second version to have a real proxy mode implemented, and not a simple URL translation”.