Skip to content

Commit

Permalink
Added openwisp2_nginx_ipv6 variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Jul 6, 2016
1 parent 7406a55 commit bb6f9a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ Below are listed all the variables you can customize.
- django_extensions
# spdy protocol in nginx is enabled by default
openwisp2_nginx_spdy: true
# ipv6 must be enabled explicitly to avoid errors
openwisp2_nginx_ipv6: false
# enable sentry
openwisp2_sentry:
dsn: "https://7d2e3cd61acc32eca1fb2a390f7b55e1:[email protected]:443/12345"
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ openwisp2_http_allowed_ip: false
openwisp2_extra_django_apps:
- django_extensions
openwisp2_nginx_spdy: true
openwisp2_nginx_ipv6: false
openwisp2_sentry:
dsn: false
4 changes: 2 additions & 2 deletions templates/nginx.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
listen 443 ssl{% if openwisp2_nginx_spdy %} spdy{% endif %}; # ipv4
#listen [::]:443 ssl; # ipv6
{% if openwisp2_nginx_ipv6 %}listen [::]:443 ssl{% if openwisp2_nginx_spdy %} spdy{% endif %}; # ipv6{% endif %}

# accepted hostnames on port 443
server_name {{ inventory_hostname }}{% for host in openwisp2_allowed_hosts %} {{ host }}{% endfor %};
Expand Down Expand Up @@ -48,7 +48,7 @@ server {

server {
listen 80{% if openwisp2_nginx_spdy %} spdy{% endif %}; # ipv4
#listen [::]:80; # ipv6
{% if openwisp2_nginx_ipv6 %}listen [::]:80{% if openwisp2_nginx_spdy %} spdy{% endif %}; # ipv6{% endif %}

# accepted hostnames on port 80
server_name {{ inventory_hostname }}{% for host in openwisp2_allowed_hosts %} {{ host }}{% endfor %};
Expand Down

0 comments on commit bb6f9a8

Please sign in to comment.