Fix spacing bugs with regex, fix remote profile regex, add comments to match nginx config, format syntax for readability

This commit is contained in:
KemoNine 2019-01-06 18:50:14 +00:00
parent 96267eb2fd
commit faa283ef7d
1 changed files with 176 additions and 144 deletions

320
Caddyfile
View File

@ -1,145 +1,177 @@
halcyon.domain.tld { halcyon.domain.tld {
tls user@domain.tld tls user@domain.tld
log /var/log/caddy/halcyon.log log /var/log/caddy/halcyon.log
fastcgi / 127.0.0.1:9000 php fastcgi / 127.0.0.1:9000 php
root /opt/halcyon root /opt/halcyon
status 404 { status 404 {
/config.ini /config.ini
/.bat /.bat
/.git /.git
/.ini /.ini
/.sh /.sh
/.svn /.svn
/.txt /.txt
/.tpl /.tpl
/.xml /.xml
} }
rewrite {
r ^/home/?$ # Begin Main
to / rewrite {
} r ^/home/?$
rewrite { to /
r ^/login/?$ }
to /login/login.php rewrite {
} r ^/login/?$
rewrite { to /login/login.php
r ^/auth/?$ }
to /login/auth.php rewrite {
} r ^/auth/?$
rewrite { to /login/auth.php
r ^/logout/?$ }
to /login/logout.php rewrite {
} r ^/logout/?$
rewrite { to /login/logout.php
r ^/terms/?$ }
to /login/terms.php rewrite {
} r ^/terms/?$
rewrite { to /login/terms.php
r ^/privacy/?$ }
to /login/privacy.php rewrite {
} r ^/privacy/?$
rewrite { to /login/privacy.php
r ^/imprint/?$ }
to /login/imprint.php rewrite {
} r ^/imprint/?$
rewrite { to /login/imprint.php
r ^/local/?$ }
to /local.php # End Main
}
rewrite { # LTL
r ^/federated/?$ rewrite {
to /federated.php r ^/local/?$
} to /local.php
rewrite { }
r ^/notifications/?$
to /notifications.php # FTL
} rewrite {
rewrite { r ^/federated/?$
r ^/whotofollow/?$ to /federated.php
to /who_to_follow.php }
}
rewrite { # Notice
r ^/direct/?$ rewrite {
to direct.php r ^/notifications/?$
} to /notifications.php
rewrite { }
r ^/instance/?$
to instance.php # Who to follow
} rewrite {
rewrite { r ^/whotofollow/?$
r ^/lists/?$ to /who_to_follow.php
to lists.php }
}
rewrite{ # Direct
r ^/lists/(\d+)/?$ rewrite {
to lists_view.php?id={1} r ^/direct/?$
} to direct.php
rewrite{ }
r ^/lists/(\d+)/add/?$
to lists_add.php?id={1} # Instance
} rewrite {
rewrite { r ^/instance/?$
r ^/search/?$ to instance.php
to /search_hash_tag.php }
}
rewrite { # Begin Lists
r ^/search/users/?$ rewrite {
to /search_user.php r ^/lists/?$
} to lists.php
rewrite { }
r ^/settings/?$ rewrite {
to /settings_general.php r ^/lists/(\d+)/?$
} to lists_view.php?id={1}
rewrite { }
r ^/settings/profile/?$ rewrite {
to /settings_profile.php r ^/lists/(\d+)/add/?$
} to lists_add.php?id={1}
rewrite { }
r ^/settings/appearance/?$ # End Lists
to /settings_appearance.php
} # Begin Search
rewrite { rewrite {
r ^/settings/filters/?$ r ^/search/?$
to /settings_filters.php to /search_hash_tag.php
} }
rewrite { rewrite {
r ^/@(.+)@(.+).([a-z]+)/?$ r ^/search/users/?$
to /user.php?user=@{1}@{2}.{3} to /search_user.php
} }
rewrite { # End Search
r ^/@(.+)@(.+).([a-z]+)/status/(.+?)?$
to /user.php?user=@{1}@{2}.{3}&status={4} # Begin Settings
} rewrite {
rewrite { r ^/settings/?$
r ^/@(.+)@(.+).([a-z]+)/media/?$ to /settings_general.php
to /user_only_media.php?user=@{1}@{2}.{3} }
} rewrite {
rewrite { r ^/settings/profile/?$
r ^/@(.+)@(.+).([a-z]+)/with_replies/?$ to /settings_profile.php
to /user_include_replies.php?user=@{1}@{2}.{3} }
} rewrite {
rewrite { r ^/settings/appearance/?$
r ^/@(.+)@(.+).([a-z]+)/followers/?$ to /settings_appearance.php
to /user_followers.php?user=@{1}@{2}.{3} }
} rewrite {
rewrite { r ^/settings/filters/?$
r ^/@(.+)@(.+).([a-z]+)/following/?$ to /settings_filters.php
to /user_following.php?user=@{1}@{2}.{3} }
} # End settings
rewrite {
r ^/@(.+)@(.+).([a-z]+)/favourites/?$ # Begin user
to /user_favorite.php?user=@{1}@{2}.{3} rewrite {
} r ^/@(.+)@(.+)\.([a-z]+)/?$
rewrite { to /user.php?user=@{1}@{2}.{3}
r ^/avatars/original/missing.png$ }
to /assets/images/missing.png rewrite {
} r ^/@(.+)@(.+)\.([a-z]+)/status/(.+?)?$
rewrite { to /user.php?user=@{1}@{2}\.{3}&status={4}
r ^/headers/original/missing.png$ }
to /assets/images/missing_header.png rewrite {
} r ^/@(.+)@(.+)\.([a-z]+)/media/?$
rewrite { to /user_only_media.php?user=@{1}@{2}\.{3}
r ^/404/?$ }
to /404.php rewrite {
} r ^/@(.+)@(.+)\.([a-z]+)/with_replies/?$
to /user_include_replies.php?user=@{1}@{2}\.{3}
}
rewrite {
r ^/@(.+)@(.+)\.([a-z]+)/followers/?$
to /user_followers.php?user=@{1}@{2}\.{3}
}
rewrite {
r ^/@(.+)@(.+)\.([a-z]+)/following/?$
to /user_following.php?user=@{1}@{2}\.{3}
}
rewrite {
r ^/@(.+)@(.+)\.([a-z]+)/favourites/?$
to /user_favorite.php?user=@{1}@{2}\.{3}
}
# End User
# Begin Image
rewrite {
r ^/avatars/original/missing.png$
to /assets/images/missing.png
}
rewrite {
r ^/headers/original/missing.png$
to /assets/images/missing_header.png
}
# End Image
# 404
rewrite {
r ^/404/?$
to /404.php
}
} }