Fix redirect and servername issue in freshmaker role.

This commit is contained in:
Ralph Bean 2018-02-02 15:29:46 +00:00
parent ead99e7441
commit 0da5d836e2
2 changed files with 8 additions and 7 deletions

View file

@ -61,6 +61,7 @@
- role: freshmaker/frontend - role: freshmaker/frontend
# TLS is terminated for us at the proxy layer (like for every other app). # TLS is terminated for us at the proxy layer (like for every other app).
freshmaker_force_ssl: False freshmaker_force_ssl: False
freshmaker_servername: freshmaker{{env_suffix}}.fedoraproject.org
handlers: handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml" - import_tasks: "{{ handlers_path }}/restart_services.yml"

View file

@ -8,13 +8,13 @@ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
WSGIDaemonProcess freshmaker user=fedmsg group=fedmsg threads=5 home=/usr/share/freshmaker WSGIDaemonProcess freshmaker user=fedmsg group=fedmsg threads=5 home=/usr/share/freshmaker
WSGIScriptAlias /{{ freshmaker_endpoint }} /usr/share/freshmaker/freshmaker.wsgi WSGIScriptAlias /{{ freshmaker_endpoint }} /usr/share/freshmaker/freshmaker.wsgi
{% if freshmaker_servername != inventory_hostname %} ##{% if freshmaker_servername != inventory_hostname %}
# Redirect from the hostname of this machine to user-visible hostname. ### Redirect from the hostname of this machine to user-visible hostname.
RewriteEngine On ##RewriteEngine On
<If "%{HTTP_HOST} == '{{ inventory_hostname }}'"> ##<If "%{HTTP_HOST} == '{{ inventory_hostname }}'">
RewriteRule (.*) "%{REQUEST_SCHEME}://{{ freshmaker_servername }}%{REQUEST_URI}" [R,L] ##RewriteRule (.*) "%{REQUEST_SCHEME}://{{ freshmaker_servername }}%{REQUEST_URI}" [R,L]
</If> ##</If>
{% endif %} ##{% endif %}
{% if env == 'staging' %} {% if env == 'staging' %}
OIDCOAuthClientID {{ freshmaker_stg_oidc_client_id }} OIDCOAuthClientID {{ freshmaker_stg_oidc_client_id }}