feat: Added configuration files for nginx & caddy (#1787)

* feat(web servers configs): Added configuration files for `nginx` & `caddy`

* Update nginx.conf

* Updated

* Update Caddyfile

* Update Caddyfile

* Update Caddyfile

* Update Caddyfile
This commit is contained in:
Roman Kelesidis 2025-02-16 16:48:13 +03:00 committed by GitHub
commit f7d394607e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 63 additions and 2 deletions

View file

@ -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)

22
install/Caddyfile Normal file
View file

@ -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

39
install/nginx.conf Normal file
View file

@ -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;
}
}