2018-10-04 02:33:13 +02:00
|
|
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
2018-10-04 03:05:11 +02:00
|
|
|
root __FINALPATH__/;
|
2018-10-04 02:33:13 +02:00
|
|
|
location __PATH__/ {
|
|
|
|
|
|
|
|
# Force usage of https
|
|
|
|
if ($scheme = http) {
|
|
|
|
rewrite ^ https://$server_name$request_uri? permanent;
|
|
|
|
}
|
|
|
|
|
2019-12-01 19:53:23 +01:00
|
|
|
### Example PHP configuration (remove it if not used)
|
2018-10-04 03:05:11 +02:00
|
|
|
index index.php;
|
2018-10-04 02:33:13 +02:00
|
|
|
|
|
|
|
# Include SSOWAT user panel.
|
|
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
|
|
}
|
|
|
|
location ~* (?:DESIGN|(?:gpl|README|LICENSE)[^.]*|LEGALNOTICE)(?:\.txt)*$ {
|
|
|
|
return 302 /;
|
|
|
|
}
|
|
|
|
location ~* \.(?:bat|git|ini|sh|svn[^.]*|txt|tpl|xml)$ {
|
|
|
|
return 404;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Main
|
|
|
|
rewrite ^/home/?$ / permanent;
|
2019-12-01 19:53:23 +01:00
|
|
|
rewrite ^/intent/toot/?$ /share.php break;
|
2018-10-04 02:33:13 +02:00
|
|
|
rewrite ^/login/?$ /login/login.php break;
|
|
|
|
rewrite ^/auth/?$ /login/auth.php break;
|
|
|
|
rewrite ^/logout/?$ /login/logout.php break;
|
|
|
|
rewrite ^/terms/?$ /login/terms.php break;
|
|
|
|
rewrite ^/privacy/?$ /login/privacy.php break;
|
|
|
|
rewrite ^/imprint/?$ /login/imprint.php break;
|
|
|
|
|
|
|
|
# LTL
|
|
|
|
rewrite ^/local/?$ /local.php break;
|
|
|
|
|
|
|
|
# FTL
|
|
|
|
rewrite ^/federated/?$ /federated.php break;
|
|
|
|
|
|
|
|
# Notice
|
|
|
|
rewrite ^/notifications/?$ /notifications.php break;
|
|
|
|
|
|
|
|
# Who to follow
|
|
|
|
rewrite ^/whotofollow/?$ /who_to_follow.php break;
|
|
|
|
|
|
|
|
# Direct
|
|
|
|
rewrite ^/direct/?$ /direct.php break;
|
|
|
|
|
2019-12-01 19:53:23 +01:00
|
|
|
# Instance
|
|
|
|
rewrite ^/instance/?$ /instance.php break;
|
|
|
|
|
2018-10-04 02:33:13 +02:00
|
|
|
# Lists
|
|
|
|
rewrite ^/lists/?$ /lists.php break;
|
|
|
|
rewrite ^/lists/(\d+)/?$ /lists_view.php?id=$1 break;
|
|
|
|
rewrite ^/lists/(\d+)/add/?$ /lists_add.php?id=$1 break;
|
|
|
|
|
|
|
|
# Search
|
|
|
|
rewrite ^/search/?$ /search_hash_tag.php break;
|
|
|
|
rewrite ^/search/users/?$ /search_user.php break;
|
|
|
|
|
|
|
|
# Settings
|
|
|
|
rewrite ^/settings/?$ /settings_general.php break;
|
|
|
|
rewrite ^/settings/profile/?$ /settings_profile.php break;
|
|
|
|
rewrite ^/settings/appearance/?$ /settings_appearance.php break;
|
2019-12-01 19:53:23 +01:00
|
|
|
rewrite ^/settings/filters/?$ /settings_filters.php break;
|
|
|
|
rewrite ^/settings/media/?$ /settings_media.php break;
|
|
|
|
rewrite ^/settings/followers/?$ /settings_accounts.php break;
|
|
|
|
rewrite ^/settings/mutes/?$ /settings_accounts.php break;
|
|
|
|
rewrite ^/settings/blocks/?$ /settings_accounts.php break;
|
|
|
|
|
2018-10-04 02:33:13 +02:00
|
|
|
|
|
|
|
# User
|
|
|
|
rewrite ^/@(.+)@(.+)\.([a-z]+)/?$ /user.php?user=@$1@$2\.$3 break;
|
|
|
|
rewrite ^/@(.+)@(.+)\.([a-z]+)/status/(.+?)?$ /user.php?user=@$1@$2\.$3&status=$4 break;
|
|
|
|
rewrite ^/@(.+)@(.+)\.([a-z]+)/media/?$ /user_only_media.php?user=@$1@$2\.$3 break;
|
|
|
|
rewrite ^/@(.+)@(.+)\.([a-z]+)/with_replies/?$ /user_include_replies.php?user=@$1@$2\.$3 break;
|
|
|
|
rewrite ^/@(.+)@(.+)\.([a-z]+)/followers/?$ /user_followers.php?user=@$1@$2\.$3 break;
|
|
|
|
rewrite ^/@(.+)@(.+)\.([a-z]+)/following/?$ /user_following.php?user=@$1@$2\.$3 break;
|
|
|
|
rewrite ^/@(.+)@(.+)\.([a-z]+)/favourites/?$ /user_favorite.php?user=@$1@$2\.$3 break;
|
|
|
|
|
|
|
|
# Image
|
|
|
|
rewrite ^/avatars/original/missing.png$ /assets/images/missing.png break;
|
|
|
|
rewrite ^/headers/original/missing.png$ /assets/images/missing_header.png break;
|
|
|
|
|
|
|
|
# 404
|
|
|
|
rewrite ^/404/?$ /404.php break;
|
|
|
|
|
|
|
|
location ~ [^/]\.php(/|$) {
|
|
|
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
|
|
include fastcgi_params;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
|
if (!-f $document_root$fastcgi_script_name) {
|
|
|
|
return 404;
|
|
|
|
}
|
|
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
|
|
fastcgi_param HTTPS on;
|
|
|
|
fastcgi_buffers 8 256k;
|
|
|
|
fastcgi_buffer_size 128k;
|
|
|
|
fastcgi_intercept_errors on;
|
2021-01-09 15:25:19 +01:00
|
|
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
2018-10-04 02:33:13 +02:00
|
|
|
}
|