Skip to content

Commit

Permalink
Implement custom 502 page (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto authored Dec 16, 2024
1 parent 6a93afe commit d0d88bb
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions files/nginx/error502.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>

<head>
<title>Galaxy on ResearchCloud</title>
<meta http-equiv="refresh" content="10">
</head>

<body>
<h2>Welcome To Galaxy on ResearchCloud</h2>
<p>It looks like Galaxy is not running. Most probably this means Galaxy is still starting up. Please wait!</p>
<p>If Galaxy is still not running after ~5 minutes, please contact your sysadmin for support.</p>
<p>This page will refresh every 10 seconds.</p>
</body>

</html>
3 changes: 3 additions & 0 deletions galaxysrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
- 'gnutls-bin' # workaround for git-clone issue, https://stackoverflow.com/a/53147659/4326632
state: present

- name: Additional nginx config
ansible.builtin.include_tasks: tasks/nginx.yml

roles:
- role: geerlingguy.docker
when: not _molecule_active and _galaxy_enable_docker
Expand Down
9 changes: 9 additions & 0 deletions tasks/nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

- name: Add custom 502 page
ansible.builtin.copy:
src: nginx/error502.html
dest: "{{ _galaxy_error_502 }}"
owner: www-data
group: www-data
mode: "0740"
1 change: 1 addition & 0 deletions vars/internal_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _galaxy_custom_repo_workflow_location: 'workflows'
_galaxy_root: /srv/galaxy

_galaxy_local_address: localhost:8080
_galaxy_error_502: /var/www/galaxy500.html

galaxy_src_documentation: https://github.com/UtrechtUniversity/vre-docs

Expand Down
5 changes: 5 additions & 0 deletions vars/nginx_vars.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
galaxy_nginx_vhost_config:
- name: galaxy
location: /
error_page: 502 /err_502.html
proxy_pass: "http://{{ _galaxy_local_address }}"
auth: "{{ _molecule_active | ternary(omit, 'sram') }}"
proxy_set_header:
Expand All @@ -27,3 +28,7 @@ galaxy_nginx_vhost_config:
proxy_redirect: 'off'
proxy_http_version: '1.1'
proxy_pass: "http://localhost:{{ gie_proxy_port }}"
- name: custom_errpage
location: = /err_502.html
root: "{{ _galaxy_error_502 }}"
internal: ''

0 comments on commit d0d88bb

Please sign in to comment.