proxy_host.conf 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 }}_access.log proxy;
  19. error_log /data/logs/proxy-host-{{ id }}_error.log warn;
  20. {{ advanced_config }}
  21. {{ locations }}
  22. {% if use_default_location %}
  23. location / {
  24. {% include "_access.conf" %}
  25. {% include "_hsts.conf" %}
  26. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  27. proxy_set_header Upgrade $http_upgrade;
  28. proxy_set_header Connection $http_connection;
  29. proxy_http_version 1.1;
  30. {% endif %}
  31. # Proxy!
  32. include conf.d/include/proxy.conf;
  33. }
  34. {% endif %}
  35. # Custom
  36. include /data/nginx/custom/server_proxy[.]conf;
  37. }
  38. {% endif %}