firmware.srv.in.ffho.net 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # /etc/nginx/sites-enabled/firmware.in.ffho.net (Salt managed)
  3. #
  4. {%- set acme_thumbprint = salt['pillar.get']('acme:thumbprint', False) %}
  5. server {
  6. listen 80;
  7. listen [::]:80;
  8. root {{salt['pillar.get']('nodes:' ~ grains['id'] ~ ':path:firmware', [])}};
  9. server_name ~^firmware\.((srv\.)?in|im)\.ffho\.net$;
  10. fancyindex on;
  11. fancyindex_exact_size off;
  12. fancyindex_name_length 70;
  13. fancyindex_header /header.html;
  14. fancyindex_localtime on;
  15. fancyindex_default_sort name;
  16. location / {
  17. try_files $uri $uri/ /index.html =404;
  18. fancyindex_ignore header.html favicon.ico models-short.txt models.txt robots.txt scripts;
  19. }
  20. {%- if acme_thumbprint %}
  21. location ~ "^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$" {
  22. default_type text/plain;
  23. return 200 "$1.{{ acme_thumbprint }}";
  24. }
  25. {%- endif %}
  26. location ~ /\. {
  27. deny all;
  28. }
  29. location /scripts {
  30. deny all;
  31. }
  32. location ~ ^/(?<site_code>(ffho(_(\w\w\w))?(_(cty|uml))?))/(stable|testing|experimental)/sysupgrade/((?<branch>(stable|testing|experimental))\.manifest)$ {
  33. disable_symlinks off;
  34. try_files $uri /$branch/sysupgrade/$branch.$site_code.manifest /$branch/sysupgrade/$branch.manifest;
  35. }
  36. location ~ ^/(?<site_code>(ffho(_(\w\w\w))?(_(cty|uml))?))/(?<branch>(stable|testing|experimental))/sysupgrade/(?<file>.*) {
  37. disable_symlinks off;
  38. try_files $uri /$branch/sysupgrade/$file /stable/sysupgrade/$file /testing/sysupgrade/$file /experimental/sysupgrade/$file;
  39. }
  40. # opkg mirror
  41. location ~^/openwrt/(?<file>.+)$ {
  42. return 302 http://ftp.stw-bonn.de/pub/openwrt/$file;
  43. }
  44. # lede mirror
  45. location ~^/lede/(?<file>.+)$ {
  46. return 302 http://downloads.lede-project.org/releases/$file;
  47. }
  48. }