fix redirect https : show port only if not 443

This commit is contained in:
Emilien Mantel
2017-04-13 15:16:53 +02:00
parent f1af8991fd
commit a60e81cc1f
2 changed files with 9 additions and 8 deletions

View File

@@ -215,6 +215,7 @@
- name:
- 'test-ssl-redirect-many.local'
- 'test-ssl-redirect-many2.local'
listen_ssl: [8443]
proto: ['https']
template: '_base'
ssl_name: 'test-ssl.local'
@@ -381,16 +382,16 @@
- 'test-ssl-predeployed.local'
- 'test-ssl.local'
- name: -- VERIFY SSL REDIRECT --
command: "curl -v --insecure -H 'Host: {{ item }}' http://127.0.0.1/"
command: "curl -v -H 'Host: {{ item.name }}' http://127.0.0.1/"
changed_when: false
register: sslredirok
failed_when: >
sslredirok.stderr.find('< Location') == -1 and
sslredirok.stderr.find('https://{{ item }}/') == -1
failed_when: "'< Location: https://{{ item.name }}{{ ':' + item.port if item.port is defined else '' }}/' not in sslredirok.stderr"
with_items:
- 'test-ssl-redirect.local'
- 'test-ssl-redirect-many.local'
- 'test-ssl-redirect-many2.local'
- name: 'test-ssl-redirect.local'
- name: 'test-ssl-redirect-many.local'
port: '8443'
- name: 'test-ssl-redirect-many2.local'
port: '8443'
# --------------------------------
# Default vhosts