Caddyfile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. halcyon.domain.tld {
  2. tls user@domain.tld
  3. log /var/log/caddy/halcyon.log
  4. fastcgi / 127.0.0.1:9000 php
  5. root /opt/halcyon
  6. status 404 {
  7. /config.ini
  8. /.bat
  9. /.git
  10. /.ini
  11. /.sh
  12. /.svn
  13. /.txt
  14. /.tpl
  15. /.xml
  16. }
  17. # Begin Main
  18. rewrite {
  19. r ^/home/?$
  20. to /
  21. }
  22. rewrite {
  23. r ^/login/?$
  24. to /login/login.php
  25. }
  26. rewrite {
  27. r ^/auth/?$
  28. to /login/auth.php
  29. }
  30. rewrite {
  31. r ^/logout/?$
  32. to /login/logout.php
  33. }
  34. rewrite {
  35. r ^/terms/?$
  36. to /login/terms.php
  37. }
  38. rewrite {
  39. r ^/privacy/?$
  40. to /login/privacy.php
  41. }
  42. rewrite {
  43. r ^/imprint/?$
  44. to /login/imprint.php
  45. }
  46. # End Main
  47. # LTL
  48. rewrite {
  49. r ^/local/?$
  50. to /local.php
  51. }
  52. # FTL
  53. rewrite {
  54. r ^/federated/?$
  55. to /federated.php
  56. }
  57. # Notice
  58. rewrite {
  59. r ^/notifications/?$
  60. to /notifications.php
  61. }
  62. # Who to follow
  63. rewrite {
  64. r ^/whotofollow/?$
  65. to /who_to_follow.php
  66. }
  67. # Direct
  68. rewrite {
  69. r ^/direct/?$
  70. to direct.php
  71. }
  72. # Instance
  73. rewrite {
  74. r ^/instance/?$
  75. to instance.php
  76. }
  77. # Begin Lists
  78. rewrite {
  79. r ^/lists/?$
  80. to lists.php
  81. }
  82. rewrite {
  83. r ^/lists/(\d+)/?$
  84. to lists_view.php?id={1}
  85. }
  86. rewrite {
  87. r ^/lists/(\d+)/add/?$
  88. to lists_add.php?id={1}
  89. }
  90. # End Lists
  91. # Begin Search
  92. rewrite {
  93. r ^/search/?$
  94. to /search_hash_tag.php
  95. }
  96. rewrite {
  97. r ^/search/users/?$
  98. to /search_user.php
  99. }
  100. # End Search
  101. # Begin Settings
  102. rewrite {
  103. r ^/settings/?$
  104. to /settings_general.php
  105. }
  106. rewrite {
  107. r ^/settings/profile/?$
  108. to /settings_profile.php
  109. }
  110. rewrite {
  111. r ^/settings/appearance/?$
  112. to /settings_appearance.php
  113. }
  114. rewrite {
  115. r ^/settings/filters/?$
  116. to /settings_filters.php
  117. }
  118. rewrite {
  119. r ^/settings/media/?$
  120. to /settings_media.php
  121. }
  122. # End settings
  123. # Begin user
  124. rewrite {
  125. r ^/@(.+)@(.+)\.([a-z]+)/?$
  126. to /user.php?user=@{1}@{2}.{3}
  127. }
  128. rewrite {
  129. r ^/@(.+)@(.+)\.([a-z]+)/status/(.+?)?$
  130. to /user.php?user=@{1}@{2}\.{3}&status={4}
  131. }
  132. rewrite {
  133. r ^/@(.+)@(.+)\.([a-z]+)/media/?$
  134. to /user_only_media.php?user=@{1}@{2}\.{3}
  135. }
  136. rewrite {
  137. r ^/@(.+)@(.+)\.([a-z]+)/with_replies/?$
  138. to /user_include_replies.php?user=@{1}@{2}\.{3}
  139. }
  140. rewrite {
  141. r ^/@(.+)@(.+)\.([a-z]+)/followers/?$
  142. to /user_followers.php?user=@{1}@{2}\.{3}
  143. }
  144. rewrite {
  145. r ^/@(.+)@(.+)\.([a-z]+)/following/?$
  146. to /user_following.php?user=@{1}@{2}\.{3}
  147. }
  148. rewrite {
  149. r ^/@(.+)@(.+)\.([a-z]+)/favourites/?$
  150. to /user_favorite.php?user=@{1}@{2}\.{3}
  151. }
  152. # End User
  153. # Begin Image
  154. rewrite {
  155. r ^/avatars/original/missing.png$
  156. to /assets/images/missing.png
  157. }
  158. rewrite {
  159. r ^/headers/original/missing.png$
  160. to /assets/images/missing_header.png
  161. }
  162. # End Image
  163. # 404
  164. rewrite {
  165. r ^/404/?$
  166. to /404.php
  167. }
  168. }