Role service-nginx-firmware: add proxy to downloads.openwrt.org
This commit is contained in:
parent
a8995d573c
commit
165e22ab5e
2 changed files with 29 additions and 0 deletions
|
@ -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
|
||||
|
|
20
roles/service-nginx-firmware/templates/opkg_vhost.conf.j2
Normal file
20
roles/service-nginx-firmware/templates/opkg_vhost.conf.j2
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue