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.

32 lines
986 B

  1. server {
  2. listen 443 ssl http2;
  3. listen [::]:443 ssl http2;
  4. server_name tild.es;
  5. keepalive_timeout 5;
  6. add_header Strict-Transport-Security "max-age={{ hsts_max_age }}; includeSubDomains; preload" always;
  7. # Are these security headers unnecessary when we're just redirecting?
  8. add_header X-Content-Type-Options "nosniff" always;
  9. add_header X-Frame-Options "SAMEORIGIN" always;
  10. add_header X-Xss-Protection "1; mode=block" always;
  11. add_header Referrer-Policy "same-origin" always;
  12. # Exact location match to redirect the root url to tildes.net
  13. location = / {
  14. return 301 https://tildes.net;
  15. }
  16. # Serve the same robots.txt file as on the site itself
  17. location = /robots.txt {
  18. root {{ app_dir }}/static;
  19. }
  20. # Will match all addresses *except* exact matches above
  21. location / {
  22. # Strip any trailing slash while redirecting
  23. rewrite ^/(.*)/?$ https://tildes.net/shortener/$1 permanent;
  24. }
  25. }