diff --git a/README.md b/README.md index 0e982872d..ce8155d43 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,9 @@ and go from there. The documentation will be translated to english in the near f ## 🔧 Requirements -* Apache / nginx / caddy +* Apache / nginx ([example config](install/nginx.conf)) / caddy ([example config](install/Caddyfile)) * MySQL 5.5.3 or above / MariaDB 10.0 or above / Percona -* PHP: 8.1 / 8.2 / 8.3 +* PHP: 8.1 / 8.2 / 8.3 / 8.4 * PHP Extensions: mbstring, gd, bcmath, intl, tidy (optional), xml, xmlwriter * Crontab (Recommended) diff --git a/install/Caddyfile b/install/Caddyfile new file mode 100644 index 000000000..72bfd4265 --- /dev/null +++ b/install/Caddyfile @@ -0,0 +1,22 @@ +# Example Caddy configuration for TorrentPier + +example.com { + root * /path/to/root + encode utf8 + php_fastcgi unix//run/php/php-fpm.sock + try_files {path} {path}/ /index.php?{query} + file_server + + @blocked { + path /install/* /internal_data/* /library/* + path /.ht* /.en* + path /.git/* + path *.sql *.tpl *.db *.inc *.log *.md + } + respond @blocked 404 + + redir /sitemap.xml /sitemap/sitemap.xml +} + +# Refer to the Caddy docs for more information: +# https://caddyserver.com/docs/caddyfile diff --git a/install/nginx.conf b/install/nginx.conf new file mode 100644 index 000000000..49a407ba4 --- /dev/null +++ b/install/nginx.conf @@ -0,0 +1,39 @@ +# Example nginx configuration for TorrentPier + +server { + listen 80; # port + server_name example.com; # your domain + root /path/to/root; # folder with TorrentPier installed + index index.php; + charset utf-8; + + location / { + try_files \$uri \$uri/ /index.php?\$args; + } + + location ~ \/(install|internal_data|library)\/ { + return 404; + } + + location ~ /\.(ht|en) { + return 404; + } + + location ~ /\.git { + return 404; + } + + location ~ \.(.*sql|tpl|db|inc|log|md)$ { + return 404; + } + + rewrite ^/sitemap.xml$ /sitemap/sitemap.xml; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_pass unix:/run/php/php-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; + include fastcgi_params; + } +}