Role service-nginx-firmware: add proxy to downloads.openwrt.org

This commit is contained in:
Julian Labus 2019-03-21 15:49:01 +01:00
parent a8995d573c
commit 165e22ab5e
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
2 changed files with 29 additions and 0 deletions

View file

@ -39,3 +39,12 @@
group: root
mode: 0644
notify: reload nginx
- name: write opkg.conf
template:
src: opkg_vhost.conf.j2
dest: /etc/nginx/conf.d/opkg.conf
owner: root
group: root
mode: 0644
notify: reload nginx

View file

@ -0,0 +1,20 @@
server {
listen 80;
listen [::]:80;
server_name opkg.{{ http_domain_internal }};
allow 127.0.0.0/8;
allow ::1;
{% for prefix in internal_prefixes %}
allow {{ prefix.ipv4 }};
allow {{ prefix.ipv6 }};
{% endfor%}
deny all;
location / {
proxy_pass https://downloads.openwrt.org/;
proxy_connect_timeout 6s;
}
}