2018-04-15 19:21:52 +02:00
|
|
|
server {
|
|
|
|
listen 80;
|
2018-07-25 17:31:54 +02:00
|
|
|
listen [::]:80;
|
2018-04-15 19:21:52 +02:00
|
|
|
server_name YOUR_DOMAIN;
|
2018-07-25 17:31:54 +02:00
|
|
|
return 301 https://$server_name$request_uri;
|
2018-04-15 19:21:52 +02:00
|
|
|
}
|
|
|
|
server {
|
2018-07-25 17:31:54 +02:00
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
2018-04-15 19:21:52 +02:00
|
|
|
server_name YOUR_DOMAIN;
|
|
|
|
ssl_protocols TLSv1.2;
|
2018-07-25 17:31:54 +02:00
|
|
|
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
|
2018-04-15 19:21:52 +02:00
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
ssl_session_cache shared:SSL:10m;
|
2018-07-25 17:31:54 +02:00
|
|
|
ssl_stapling on;
|
|
|
|
ssl_stapling_verify on;
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000";
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
2018-04-15 19:21:52 +02:00
|
|
|
ssl_certificate /etc/CHANGE_THIS/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/CHANGE_THIS/privkey.pem;
|
2018-07-25 17:31:54 +02:00
|
|
|
ssl_dhparam /etc/CHANGE_THIS/dhparam.pem;
|
2018-04-15 19:21:52 +02:00
|
|
|
keepalive_timeout 70;
|
|
|
|
sendfile on;
|
2018-07-25 17:31:54 +02:00
|
|
|
client_max_body_size 20m;
|
|
|
|
root /var/www/example.com;
|
2018-04-15 19:21:52 +02:00
|
|
|
location ~* (?:DESIGN|(?:gpl|README|LICENSE)[^.]*|LEGALNOTICE)(?:\.txt)*$ {
|
|
|
|
return 302 /;
|
|
|
|
}
|
|
|
|
location ~* \.(?:bat|git|ini|sh|svn[^.]*|txt|tpl|xml)$ {
|
|
|
|
return 404;
|
|
|
|
}
|
2018-07-10 19:12:22 +02:00
|
|
|
|
|
|
|
# Main
|
2018-04-15 19:21:52 +02:00
|
|
|
rewrite ^/home/?$ / permanent;
|
2018-07-10 19:12:22 +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;
|
2018-07-25 17:31:54 +02:00
|
|
|
rewrite ^/privacy/?$ /login/privacy.php break;
|
|
|
|
rewrite ^/imprint/?$ /login/imprint.php break;
|
2018-07-10 19:12:22 +02:00
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
2018-09-23 16:14:28 +02:00
|
|
|
# Direct
|
2018-09-23 17:13:40 +02:00
|
|
|
rewrite ^/direct/?$ /direct.php break;
|
2018-09-23 16:14:28 +02:00
|
|
|
|
2018-12-02 15:01:21 +01:00
|
|
|
# Instance
|
|
|
|
rewrite ^/instance/?$ /instance.php break;
|
|
|
|
|
2018-09-23 16:14:28 +02:00
|
|
|
# Lists
|
2018-09-23 17:13:40 +02:00
|
|
|
rewrite ^/lists/?$ /lists.php break;
|
|
|
|
rewrite ^/lists/(\d+)/?$ /lists_view.php?id=$1 break;
|
|
|
|
rewrite ^/lists/(\d+)/add/?$ /lists_add.php?id=$1 break;
|
2018-09-23 16:14:28 +02:00
|
|
|
|
2018-07-10 19:12:22 +02:00
|
|
|
# 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;
|
2018-11-25 19:14:16 +01:00
|
|
|
rewrite ^/settings/filters/?$ /settings_filters.php break;
|
2018-07-10 19:12:22 +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;
|
|
|
|
|
2018-04-15 19:21:52 +02:00
|
|
|
location ~ [^/]\.php(/|$) {
|
|
|
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
2018-07-25 17:31:54 +02:00
|
|
|
include fastcgi_params;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
2018-04-15 19:21:52 +02:00
|
|
|
if (!-f $document_root$fastcgi_script_name) {
|
|
|
|
return 404;
|
|
|
|
}
|
2018-07-25 17:31:54 +02:00
|
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
|
|
fastcgi_param HTTPS on;
|
2018-04-15 19:21:52 +02:00
|
|
|
fastcgi_buffers 8 256k;
|
|
|
|
fastcgi_buffer_size 128k;
|
|
|
|
fastcgi_intercept_errors on;
|
2018-07-25 17:31:54 +02:00
|
|
|
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
|
2018-04-15 19:21:52 +02:00
|
|
|
}
|
|
|
|
}
|