How to add a proxy rule in the ood_portal.yml file?

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"