Last active
December 5, 2015 19:11
-
-
Save juniorh/30bce3317207d6b2a887 to your computer and use it in GitHub Desktop.
Nginx configuration for rutorrent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream backendrutorrent { | |
server unix:/var/run/php5-fpm.sock; | |
} | |
upstream backendrtorrent { | |
server 127.0.0.1:5000; | |
} | |
server{ | |
listen 80; | |
location / { | |
return 301 https://$host$request_uri; | |
} | |
} | |
server{ | |
listen 443 ssl; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/server.crt; | |
ssl_certificate_key /etc/nginx/ssl/server.key; | |
ssl_ciphers HIGH:!kEDH:!aNULL:!MD5; | |
ssl_ecdh_curve secp521r1; | |
ssl_prefer_server_ciphers on; | |
ssl_protocols TLSv1.2 TLSv1.1 TLSv1; | |
root /var/www/rutorrent; | |
location /files { | |
alias /data/rtorrent/download; | |
auth_basic "Restricted Access"; | |
auth_basic_user_file /etc/nginx/htpasswd.users; | |
autoindex on; | |
} | |
location /RPC2 { | |
include /etc/nginx/scgi_params; | |
scgi_pass backendrtorrent; | |
} | |
location / { | |
location ~ .php$ { | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_pass backendrutorrent; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# start all services | |
/usr/bin/tmux new-session -d -s torrent | |
/usr/bin/tmux new-window -n rtorrent -t torrent "/usr/bin/rtorrent" | |
/usr/sbin/service php5-fpm start | |
/usr/sbin/service nginx start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment