redirection_host.conf 717 B

12345678910111213141516171819202122232425262728293031
  1. {% include "_header_comment.conf" %}
  2. {% if enabled %}
  3. server {
  4. {% include "_listen.conf" %}
  5. {% include "_certificates.conf" %}
  6. {% include "_assets.conf" %}
  7. {% include "_exploits.conf" %}
  8. {% include "_hsts.conf" %}
  9. access_log /data/logs/redirection_host-{{ id }}.log standard;
  10. {{ advanced_config }}
  11. {% if use_default_location %}
  12. location / {
  13. {% include "_forced_ssl.conf" %}
  14. {% include "_hsts.conf" %}
  15. {% if preserve_path == 1 or preserve_path == true %}
  16. return 301 $scheme://{{ forward_domain_name }}$request_uri;
  17. {% else %}
  18. return 301 $scheme://{{ forward_domain_name }};
  19. {% endif %}
  20. }
  21. {% endif %}
  22. # Custom
  23. include /data/nginx/custom/server_redirect[.]conf;
  24. }
  25. {% endif %}