proxy_host.conf 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. # Access List
  19. auth_basic "Authorization required";
  20. auth_basic_user_file /data/access/{{ access_list_id }};
  21. {%- endif %}
  22. {% include "_forced_ssl.conf" %}
  23. {% include "_hsts.conf" %}
  24. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  25. proxy_set_header Upgrade $http_upgrade;
  26. proxy_set_header Connection $http_connection;
  27. proxy_http_version 1.1;
  28. {% endif %}
  29. # Proxy!
  30. include conf.d/include/proxy.conf;
  31. }
  32. {% endif %}
  33. # Custom
  34. include /data/nginx/custom/server_proxy[.]conf;
  35. }
  36. {% endif %}