proxy_host.conf 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {% include "_header_comment.conf" %}
  2. {% if enabled %}
  3. server {
  4. set $forward_scheme {{ forward_scheme }};
  5. set $server "{{ forward_host }}";
  6. set $port {{ forward_port }};
  7. {% include "_listen.conf" %}
  8. {% include "_certificates.conf" %}
  9. {% include "_assets.conf" %}
  10. {% include "_exploits.conf" %}
  11. {% include "_hsts.conf" %}
  12. access_log /data/logs/proxy_host-{{ id }}.log proxy;
  13. {{ advanced_config }}
  14. {{ locations }}
  15. {% if use_default_location %}
  16. location / {
  17. {% if access_list_id > 0 %}
  18. {% if access_list.items.length > 0 %}
  19. # Authorization
  20. auth_basic "Authorization required";
  21. auth_basic_user_file /data/access/{{ access_list_id }};
  22. {{ access_list.passauth }}
  23. {% endif %}
  24. # Access Rules
  25. {% for client in access_list.clients %}
  26. {{- client.rule -}};
  27. {% endfor %}deny all;
  28. # Access checks must...
  29. {% if access_list.satisfy %}
  30. {{ access_list.satisfy }};
  31. {% endif %}
  32. {% endif %}
  33. {% include "_forced_ssl.conf" %}
  34. {% include "_hsts.conf" %}
  35. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  36. proxy_set_header Upgrade $http_upgrade;
  37. proxy_set_header Connection $http_connection;
  38. proxy_http_version 1.1;
  39. {% endif %}
  40. # Proxy!
  41. include conf.d/include/proxy.conf;
  42. }
  43. {% endif %}
  44. # Custom
  45. include /data/nginx/custom/server_proxy[.]conf;
  46. }
  47. {% endif %}