Skip to content

Commit

Permalink
Merge pull request IQSS#165 from GlobalDataverseCommunityConsortium/1…
Browse files Browse the repository at this point in the history
…62_redirect_template

correct HTTP redirect template for both RHEL/Debian cases
  • Loading branch information
donsizemore authored Jul 29, 2021
2 parents 944640c + ac9a060 commit 303e636
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 8 additions & 3 deletions tasks/dataverse-apache-ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@
notify: enable and restart apache

- name: install http redirect template
template: src=http.redirect.conf.j2 dest="{{ apache_virtualhost_dir }}/http.redirect.conf"
owner=root group=root mode=0644
template:
src: http.redirect.conf.j2
dest: '{{ apache_virtualhost_dir }}/http.redirect.conf'
owner: root
group: root
mode: 0644
when: apache.ssl.enabled
notify: enable and restart apache

Expand All @@ -87,7 +91,8 @@
name: "{{ item }}"
ignore_configcheck: true
with_items:
- ssl
- redirect
- rewrite
- ssl
when: ansible_os_family == "Debian" ## CHECKME -- does this need to be Debian-specific?
notify: enable and restart apache
8 changes: 3 additions & 5 deletions templates/http.redirect.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

ServerName {{ servername }}

<IfModule mod_rewrite>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</IfModule>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

</VirtualHost>

0 comments on commit 303e636

Please sign in to comment.