proxy_host.conf 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {% include "_header_comment.conf" %}
  2. {% if enabled %}
  3. {% include "_hsts_map.conf" %}
  4. server {
  5. set $forward_scheme {{ forward_scheme }};
  6. set $server "{{ forward_host }}";
  7. set $port {{ forward_port }};
  8. {% include "_listen.conf" %}
  9. {% include "_certificates.conf" %}
  10. {% include "_assets.conf" %}
  11. {% include "_exploits.conf" %}
  12. {% include "_hsts.conf" %}
  13. {% include "_forced_ssl.conf" %}
  14. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection $http_connection;
  17. proxy_http_version 1.1;
  18. {% endif %}
  19. access_log /data/logs/proxy-host-{{ id }}_access.log proxy;
  20. error_log /data/logs/proxy-host-{{ id }}_error.log warn;
  21. {{ advanced_config }}
  22. {{ locations }}
  23. {% if use_default_location %}
  24. location / {
  25. {% include "_access.conf" %}
  26. {% include "_hsts.conf" %}
  27. {% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
  28. proxy_set_header Upgrade $http_upgrade;
  29. proxy_set_header Connection $http_connection;
  30. proxy_http_version 1.1;
  31. {% endif %}
  32. # Proxy!
  33. include conf.d/include/proxy.conf;
  34. }
  35. {% endif %}
  36. # Custom
  37. include /data/nginx/custom/server_proxy[.]conf;
  38. }
  39. {% endif %}