Skip to content

Commit

Permalink
Allow additional vhosts
Browse files Browse the repository at this point in the history
Since Opencast 16+ requires OpenSearch on the admin and presentation nodes, we should provide an option to create a virtual host for this purpose. With this patch all additional vhost configurations from /etc/nginx/sites-enabled/ will be loaded.
  • Loading branch information
wsmirnow committed Jan 31, 2025
1 parent 338e704 commit 6e76fc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ If you want to use Let's Encrypt to generate certificates, you can also include
[`elan.opencast_certbot`](https://galaxy.ansible.com/elan/opencast_certbot)
which will automatically generate TLS certificates for you.


You can also add some custom configuration in the file `/etc/nginx/conf.d/extra.conf`.
The file is included after Opencast's main `location` block.
The role will not modify this file if it exists.

Additionally you can define other virtual hosts in `/etc/nginx/sites-enabled/` directory.
They will be loaded as well.


Example Playbook
----------------
Expand Down Expand Up @@ -72,7 +74,7 @@ The role will _not_ replace an existing certificate so you can safely use a `fil
owner: root
group: root
mode: '0400'
notify: reload nginx
notify: Reload nginx
loop:
- key
- crt
Expand Down
3 changes: 3 additions & 0 deletions templates/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,7 @@ http {
# Include additional custom configuration
include /etc/nginx/conf.d/extra.conf;
}

# Include dynamic virtual host configurations
include /etc/nginx/sites-enabled/*;
}

0 comments on commit 6e76fc9

Please sign in to comment.