Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user http;
- worker_processes 2;
- #Legacy logging
- #error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- #basically inserting large blocks of code for neatness
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- #tcp_nopush on;
- #keepalive_timeout 0;
- keepalive_timeout 65;
- #gzip on;
- log_format main '$remote_addr - $remote_user [$time_local] $status '
- '"$request" $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- access_log /var/log/nginx/access.log main;
- error_log /var/log/nginx/error.log notice;
- #https://www.digitalocean.com/community/tutorials/understanding-and-implementing-fastcgi-proxying-in-nginx
- #http://crshd.github.io/2014/12/16/ruTorrent-Seedbox-on-Debian/
- #http://wiki.nginx.org/PHPFcgiExample#Connecting_nginx_to_PHP_FPM
- #http://www.juanjchong.com/2014/setting-up-rtorrentrutorrent-on-ubuntu-14-04-using-ngnix/
- #****************************************************************************************
- #Current Guide Attempt https://github.com/Novik/ruTorrent/wiki/NGINX---PHP-FPM---RTORRENT
- #****************************************************************************************
- upstream backendrutorrent {
- server unix:/var/run/php-fpm/php-fpm.sock;
- }
- upstream backendrtorrent {
- server unix:/home/rtorrent/.rtorrent.sock;
- }
- server {
- listen 8000;
- server_name swerver;
- root /etc/nginx/test;
- location ~ [^/]\.php(/.*)?$ {
- fastcgi_split_path_info ^(.+\.php)(/.*)?$;
- # the if is not really necessary.
- # php-fpm already checks if the script has a .php extension
- #~ if (!-f $document_root$fastcgi_script_name) {
- #~ return 404;
- #~ }
- fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$uri;
- fastcgi_param PATH_INFO $fastcgi_path_info if_not_empty;
- }
- }
- server {
- listen 80;
- server_name swerver;
- root /usr/share/nginx/html/rutorrent;
- index index.html index.htm;
- location /rutorrent-logs {
- access_log /var/log/nginx/rutorrent.access.log;
- error_log /var/log/nginx/rutorrent.error.log;
- location ~ [^/]\.php(/|$) {
- fastcgi_split_path_info ^(.+?\.php)(/.*)$;
- fastcgi_pass backendrutorrent;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root/rutorrent$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_intercept_errors on;
- fastcgi_ignore_client_abort off;
- fastcgi_connect_timeout 60;
- fastcgi_send_timeout 180;
- fastcgi_read_timeout 180;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 4 256k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- }
- }
- location /RPC2 {
- access_log /var/log/nginx/rutorrent.rpc2.access.log;
- error_log /var/log/nginx/rutorrent.rpc2.error.log;
- include /etc/nginx/scgi_params;
- scgi_pass backendrtorrent;
- }
- location / {
- try_files $uri $uri/ =404;
- }
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /usr/share/nginx/50x.html;
- location = /50x.html {
- }
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass http://127.0.0.1;
- #}
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- #location ~ \.php$ {
- # root html;
- # fastcgi_pass 127.0.0.1:9000;
- # fastcgi_index index.php;
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- # include fastcgi_params;
- #}
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- #location ~ /\.ht {
- # deny all;
- #}
- }
- # another virtual host using mix of IP-, name-, and port-based configuration
- #
- #server {
- # listen 8000;
- # listen somename:8080;
- # server_name somename alias another.alias;
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
- # HTTPS server
- #
- #server {
- # listen 443 ssl;
- # server_name localhost;
- # ssl_certificate cert.pem;
- # ssl_certificate_key cert.key;
- # ssl_session_cache shared:SSL:1m;
- # ssl_session_timeout 5m;
- # ssl_ciphers HIGH:!aNULL:!MD5;
- # ssl_prefer_server_ciphers on;
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement