proxy_host.conf 1.3 KB

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