Skip to content

Commit

Permalink
ui: add RUCIO_HTTPD_ADDITIONAL_REDIRECTS environment variable
Browse files Browse the repository at this point in the history
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:

```bash
    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:

```bash
    Redirect /foo http://bar
    Redirect /baz http://qux
```
  • Loading branch information
maany committed Jun 26, 2024
1 parent 48e664c commit 22a56dd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ This variable can be used to add an additional `ProxyPass` and corresponding `Pr
ProxyPassReverse /foo http://bar
```

### `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:

```bash
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:

```bash
Redirect /foo http://bar
Redirect /baz http://qux
```

### `RUCIO_HTTPD_PROXY_PROTOCOL_ENABLED`

This variable can be used to enable the `ProxyProtocol` module in the apache config. The default is `Off`. It sets the `RemoteIPProxyProtocol` directive in the apache config.
Expand Down
6 changes: 6 additions & 0 deletions ui/rucio.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ CacheRoot /tmp
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 }}
{% 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('') }}
Expand Down

0 comments on commit 22a56dd

Please sign in to comment.