mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
fix redirect https : show port only if not 443
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user