proxy_host.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. # Authorization
  19. auth_basic "Authorization required";
  20. auth_basic_user_file /data/access/{{ access_list_id }};
  21. # Access Rules
  22. {% for client in access_list.clients %}
  23. {{- client.rule -}};
  24. {% endfor %}deny all;
  25. # Access checks must...
  26. {{ access_list.satisfy }};
  27. {% endif %}
  28. {% include "_forced_ssl.conf" %}
  29. {% include "_hsts.conf" %}
  30. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  31. proxy_set_header Upgrade $http_upgrade;
  32. proxy_set_header Connection $http_connection;
  33. proxy_http_version 1.1;
  34. {% endif %}
  35. # Proxy!
  36. include conf.d/include/proxy.conf;
  37. }
  38. {% endif %}
  39. # Custom
  40. include /data/nginx/custom/server_proxy[.]conf;
  41. }
  42. {% endif %}