Caddyfile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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 ^/intent/toot/?$
  24. to /share.php
  25. }
  26. rewrite {
  27. r ^/login/?$
  28. to /login/login.php
  29. }
  30. rewrite {
  31. r ^/auth/?$
  32. to /login/auth.php
  33. }
  34. rewrite {
  35. r ^/logout/?$
  36. to /login/logout.php
  37. }
  38. rewrite {
  39. r ^/terms/?$
  40. to /login/terms.php
  41. }
  42. rewrite {
  43. r ^/privacy/?$
  44. to /login/privacy.php
  45. }
  46. rewrite {
  47. r ^/imprint/?$
  48. to /login/imprint.php
  49. }
  50. # End Main
  51. # LTL
  52. rewrite {
  53. r ^/local/?$
  54. to /local.php
  55. }
  56. # FTL
  57. rewrite {
  58. r ^/federated/?$
  59. to /federated.php
  60. }
  61. # Notice
  62. rewrite {
  63. r ^/notifications/?$
  64. to /notifications.php
  65. }
  66. # Bookmarks
  67. rewrite {
  68. r ^/bookmarks/?$
  69. to /bookmarks.php
  70. }
  71. # Who to follow
  72. rewrite {
  73. r ^/whotofollow/?$
  74. to /who_to_follow.php
  75. }
  76. # Direct
  77. rewrite {
  78. r ^/direct/?$
  79. to direct.php
  80. }
  81. # Instance
  82. rewrite {
  83. r ^/instance/?$
  84. to instance.php
  85. }
  86. # Begin Lists
  87. rewrite {
  88. r ^/lists/?$
  89. to lists.php
  90. }
  91. rewrite {
  92. r ^/lists/(\d+)/?$
  93. to lists_view.php?id={1}
  94. }
  95. rewrite {
  96. r ^/lists/(\d+)/add/?$
  97. to lists_add.php?id={1}
  98. }
  99. # End Lists
  100. # Begin Search
  101. rewrite {
  102. r ^/search/?$
  103. to /search_hash_tag.php
  104. }
  105. rewrite {
  106. r ^/search/users/?$
  107. to /search_user.php
  108. }
  109. # End Search
  110. # Begin Settings
  111. rewrite {
  112. r ^/settings/?$
  113. to /settings_general.php
  114. }
  115. rewrite {
  116. r ^/settings/profile/?$
  117. to /settings_profile.php
  118. }
  119. rewrite {
  120. r ^/settings/appearance/?$
  121. to /settings_appearance.php
  122. }
  123. rewrite {
  124. r ^/settings/filters/?$
  125. to /settings_filters.php
  126. }
  127. rewrite {
  128. r ^/settings/media/?$
  129. to /settings_media.php
  130. }
  131. rewrite {
  132. r ^/settings/followers/?$
  133. to /settings_accounts.php
  134. }
  135. rewrite {
  136. r ^/settings/mutes/?$
  137. to /settings_accounts.php
  138. }
  139. rewrite {
  140. r ^/settings/blocks/?$
  141. to /settings_accounts.php
  142. }
  143. # End settings
  144. # Begin user
  145. rewrite {
  146. r ^/@(.+)@(.+)\.([a-z]+)/?$
  147. to /user.php?user=@{1}@{2}.{3}
  148. }
  149. rewrite {
  150. r ^/@(.+)@(.+)\.([a-z]+)/status/(.+?)?$
  151. to /user.php?user=@{1}@{2}\.{3}&status={4}
  152. }
  153. rewrite {
  154. r ^/@(.+)@(.+)\.([a-z]+)/media/?$
  155. to /user_only_media.php?user=@{1}@{2}\.{3}
  156. }
  157. rewrite {
  158. r ^/@(.+)@(.+)\.([a-z]+)/with_replies/?$
  159. to /user_include_replies.php?user=@{1}@{2}\.{3}
  160. }
  161. rewrite {
  162. r ^/@(.+)@(.+)\.([a-z]+)/followers/?$
  163. to /user_followers.php?user=@{1}@{2}\.{3}
  164. }
  165. rewrite {
  166. r ^/@(.+)@(.+)\.([a-z]+)/following/?$
  167. to /user_following.php?user=@{1}@{2}\.{3}
  168. }
  169. rewrite {
  170. r ^/@(.+)@(.+)\.([a-z]+)/favourites/?$
  171. to /user_favorite.php?user=@{1}@{2}\.{3}
  172. }
  173. # End User
  174. # Begin Image
  175. rewrite {
  176. r ^/avatars/original/missing.png$
  177. to /assets/images/missing.png
  178. }
  179. rewrite {
  180. r ^/headers/original/missing.png$
  181. to /assets/images/missing_header.png
  182. }
  183. # End Image
  184. # 404
  185. rewrite {
  186. r ^/404/?$
  187. to /404.php
  188. }
  189. }