Skip to content

Commit

Permalink
ui: allow multiple ProxyPass and ProxyPassReverse httpd directives to…
Browse files Browse the repository at this point in the history
… be configured using the RUCIO_HTTPD_ADDITIONAL_PROXY_CONF environment variable
  • Loading branch information
maany committed Jun 26, 2024
1 parent 22a56dd commit 7c45913
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
11 changes: 10 additions & 1 deletion ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ This variable can be used to add an additional `ProxyPass` and corresponding `Pr
ProxyPassReverse /foo http://bar
```

You can also specify multiple proxies if you specify the value of the environment variable in the following format: `/{path1} {url1}, /{path2} {url2}, ...`. For example `RUCIO_HTTPD_ADDITIONAL_PROXY_CONF="/foo http://bar, /baz http://qux"` will add the following lines to the apache config located at `/etc/httpd/conf.d/rucio.conf` inside the container:

```bash
ProxyPass /foo http://bar
ProxyPassReverse /foo http://bar
ProxyPass /baz http://qux
ProxyPassReverse /baz http://qux
```

### `RUCIO_HTTPD_ADDITIONAL_REDIRECTS`

This variable can be used to add an additional `Redirect` in the apache config. The value should be a string with the format `/{path} {url}`. For example `RUCIO_HTTPD_ADDITIONAL_REDIRECTS="/foo http://bar"` will add the following lines to the apache config located at `/etc/httpd/conf.d/rucio.conf` inside the container:
Expand All @@ -108,7 +117,7 @@ This variable can be used to add an additional `Redirect` in the apache config.
Redirect /foo http://bar
```

You can add multiple refirects if you specify the value of the environment variable in the following format: `/{path1} {url1}, /{path2} {url2}, ...`. For example `RUCIO_HTTPD_ADDITIONAL_REDIRECTS="/foo http://bar, /baz http://qux"` will add the following lines to the apache config located at `/etc/httpd/conf.d/rucio.conf` inside the container:
You can add multiple redirects if you specify the value of the environment variable in the following format: `/{path1} {url1}, /{path2} {url2}, ...`. For example `RUCIO_HTTPD_ADDITIONAL_REDIRECTS="/foo http://bar, /baz http://qux"` will add the following lines to the apache config located at `/etc/httpd/conf.d/rucio.conf` inside the container:

```bash
Redirect /foo http://bar
Expand Down
15 changes: 8 additions & 7 deletions ui/rucio.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,20 @@ CacheRoot /tmp
ProxyPassReverse /authproxy {{ RUCIO_AUTH_PROXY_SCHEME | default('https') }}://{{ RUCIO_AUTH_PROXY }}
{% endif %}
{% if RUCIO_HTTPD_ADDITIONAL_PROXY_CONF is defined %}
ProxyPass {{ RUCIO_HTTPD_ADDITIONAL_PROXY_CONF}}
ProxyPassReverse {{ RUCIO_HTTPD_ADDITIONAL_PROXY_CONF }}
{% endif %}
{% if RUCIO_HTTPD_ADDITIONAL_REDIRECTS is defined %}
{% for redirect in RUCIO_HTTPD_ADDITIONAL_REDIRECTS.split(',') %}
Redirect {{ redirect|trim }}
{% for proxy in RUCIO_HTTPD_ADDITIONAL_PROXY_CONF.split(",") %}
ProxyPass {{ proxy|trim }}
ProxyPassReverse {{ proxy|trim }}
{% endfor %}
ProxyPassReverse {{ RUCIO_HTTPD_ADDITIONAL_PROXY_CONF }}
{% endif %}
{% if RUCIO_HTTPD_PROXY_PROTOCOL_ENABLED | default('False') == 'True' %}
RemoteIPProxyProtocol On
RemoteIPProxyProtocolExceptions 127.0.0.1 ::1 {{ RUCIO_HTTPD_PROXY_PROTOCOL_EXCEPTIONS | default('') }}
{% endif %}
{% if RUCIO_HTTPD_ADDITIONAL_REDIRECTS is defined %}
{% for redirect in RUCIO_HTTPD_ADDITIONAL_REDIRECTS.split(',') %}
Redirect {{ redirect|trim }}
{% endfor %}
{% endif %}
{% endmacro %}

<VirtualHost *:80>
Expand Down

0 comments on commit 7c45913

Please sign in to comment.