You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.8 KiB

  1. {% for subdomain in ('blog', 'docs') %}
  2. server {
  3. listen 443 ssl http2;
  4. listen [::]:443 ssl http2;
  5. add_header Strict-Transport-Security "max-age={{ hsts_max_age }}; includeSubDomains; preload" always;
  6. add_header X-Content-Type-Options "nosniff" always;
  7. add_header X-Frame-Options "SAMEORIGIN" always;
  8. add_header X-Xss-Protection "1; mode=block" always;
  9. add_header Referrer-Policy "strict-origin-when-cross-origin" always;
  10. server_name {{ subdomain }}.tildes.net;
  11. keepalive_timeout 5;
  12. gzip_static on;
  13. {% if subdomain == "docs" %}
  14. # redirects for old docs urls, 302s in case we ever want to re-use these slugs
  15. location /code-of-conduct {
  16. return 302 https://docs.tildes.net/policies/code-of-conduct;
  17. }
  18. location /mechanics {
  19. return 302 https://docs.tildes.net/instructions;
  20. }
  21. location /overall-goals {
  22. return 302 https://docs.tildes.net/philosophy;
  23. }
  24. location /privacy-policy {
  25. return 302 https://docs.tildes.net/policies/privacy-policy;
  26. }
  27. location /technical-goals {
  28. return 302 https://docs.tildes.net/philosophy/site-implementation;
  29. }
  30. location /terms-of-use {
  31. return 302 https://docs.tildes.net/policies/terms-of-use;
  32. }
  33. location /text-formatting {
  34. return 302 https://docs.tildes.net/instructions/text-formatting;
  35. }
  36. location /topic-tagging {
  37. return 302 https://docs.tildes.net/instructions/posting-on-tildes#tagging-topics;
  38. }
  39. {% endif %}
  40. location /favicon.ico {
  41. root /opt/tildes-static-sites/theme/images;
  42. try_files $uri =404;
  43. }
  44. location /theme {
  45. root {{ static_sites_dir }};
  46. try_files $uri =404;
  47. }
  48. location / {
  49. root {{ static_sites_dir }}/{{ subdomain }};
  50. try_files $uri $uri.html $uri/index.html =404;
  51. }
  52. }
  53. {% endfor %}