proxy_host.conf 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. {% include "_forced_ssl.conf" %}
  13. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  14. proxy_set_header Upgrade $http_upgrade;
  15. proxy_set_header Connection $http_connection;
  16. proxy_http_version 1.1;
  17. {% endif %}
  18. access_log /data/logs/proxy_host-{{ id }}.log proxy;
  19. {{ advanced_config }}
  20. {{ locations }}
  21. {% if use_default_location %}
  22. location / {
  23. {% if access_list_id > 0 %}
  24. {% if access_list.items.length > 0 %}
  25. # Authorization
  26. auth_basic "Authorization required";
  27. auth_basic_user_file /data/access/{{ access_list_id }};
  28. {{ access_list.passauth }}
  29. {% endif %}
  30. # Access Rules
  31. {% for client in access_list.clients %}
  32. {{- client.rule -}};
  33. {% endfor %}deny all;
  34. # Access checks must...
  35. {% if access_list.satisfy %}
  36. {{ access_list.satisfy }};
  37. {% endif %}
  38. {% endif %}
  39. {% include "_hsts.conf" %}
  40. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  41. proxy_set_header Upgrade $http_upgrade;
  42. proxy_set_header Connection $http_connection;
  43. proxy_http_version 1.1;
  44. {% endif %}
  45. # Proxy!
  46. include conf.d/include/proxy.conf;
  47. }
  48. {% endif %}
  49. # Custom
  50. include /data/nginx/custom/server_proxy[.]conf;
  51. }
  52. {% endif %}