Skip to content

Commit

Permalink
Merge pull request #21 from Rosa-Luxemburgstiftung-Berlin/rewriteurl2…
Browse files Browse the repository at this point in the history
…fqdn

enforce apache to redirect to the hostname configured for openproject
  • Loading branch information
zerwes authored Jun 9, 2024
2 parents 02b0dfe + 18d2127 commit 9847984
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,11 @@
- openproject_recover_from_backup is defined
- openproject_recover_from_backup | bool

- name: enforce apache to use {{ openproject_server.hostname }}
ansible.builtin.template:
src: rewriteurl2fqdn.j2
dest: /etc/openproject/addons/apache2/includes/vhost/rewriteurl2fqdn.conf
mode: '0644'
notify: apache2 restart

# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 smartindent nu ft=yaml
3 changes: 3 additions & 0 deletions templates/rewriteurl2fqdn.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RewriteEngine On
RewriteCond %{SERVER_NAME} !={{ openproject_server.hostname }}
RewriteRule .* https://{{ openproject_server.hostname }}%{REQUEST_URI} [NE,R,L]

0 comments on commit 9847984

Please sign in to comment.