Advertisement
Guest User

nginx.conf with broken php

a guest
Sep 21st, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 5.51 KB | None | 0 0
  1.  
  2. user http;
  3. worker_processes  2;
  4.  
  5. #Legacy logging
  6. #error_log  logs/error.log;
  7. #error_log  logs/error.log  notice;
  8. #error_log  logs/error.log  info;
  9. #pid        logs/nginx.pid;
  10.  
  11.  
  12. events {
  13.     worker_connections  1024;
  14. }
  15.  
  16.  
  17.  
  18. http {
  19.  
  20. #basically inserting large blocks of code for neatness
  21.     include       mime.types;
  22.     default_type  application/octet-stream;
  23.     sendfile        on;
  24.     #tcp_nopush     on;
  25.     #keepalive_timeout  0;
  26.     keepalive_timeout  65;
  27.     #gzip  on;
  28.  
  29.     log_format   main '$remote_addr - $remote_user [$time_local]  $status '
  30.      '"$request" $body_bytes_sent "$http_referer" '
  31.      '"$http_user_agent" "$http_x_forwarded_for"';
  32.  
  33.     access_log  /var/log/nginx/access.log  main;
  34.     error_log   /var/log/nginx/error.log notice;
  35.  
  36.  
  37. #https://www.digitalocean.com/community/tutorials/understanding-and-implementing-fastcgi-proxying-in-nginx
  38. #http://crshd.github.io/2014/12/16/ruTorrent-Seedbox-on-Debian/
  39. #http://wiki.nginx.org/PHPFcgiExample#Connecting_nginx_to_PHP_FPM
  40. #http://www.juanjchong.com/2014/setting-up-rtorrentrutorrent-on-ubuntu-14-04-using-ngnix/
  41.  
  42. #****************************************************************************************
  43. #Current Guide Attempt https://github.com/Novik/ruTorrent/wiki/NGINX---PHP-FPM---RTORRENT
  44. #****************************************************************************************
  45.  
  46.     upstream backendrutorrent {
  47.             server unix:/var/run/php-fpm/php-fpm.sock;
  48.     }
  49.     upstream backendrtorrent {
  50.             server unix:/home/rtorrent/.rtorrent.sock;
  51.     }
  52.  
  53.     server {
  54.         listen 8000;
  55.         server_name swerver;
  56.         root /etc/nginx/test;
  57. location ~ [^/]\.php(/.*)?$ {
  58.             fastcgi_split_path_info ^(.+\.php)(/.*)?$;
  59.             # the if is not really necessary.
  60.             # php-fpm already checks if the script has a .php extension
  61.             #~ if (!-f $document_root$fastcgi_script_name) {
  62.             #~    return 404;
  63.             #~ }
  64.             fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
  65.             fastcgi_index  index.php;
  66.             include fastcgi_params;
  67.             fastcgi_param SCRIPT_FILENAME $document_root$uri;
  68.             fastcgi_param PATH_INFO $fastcgi_path_info if_not_empty;
  69.         }
  70.              
  71.      }
  72.  
  73.     server {
  74.         listen       80;
  75.         server_name  swerver;
  76.         root   /usr/share/nginx/html/rutorrent;
  77.         index  index.html index.htm;
  78.  
  79.     location /rutorrent-logs {
  80.         access_log /var/log/nginx/rutorrent.access.log;
  81.         error_log /var/log/nginx/rutorrent.error.log;
  82.  
  83.  
  84.     location ~ [^/]\.php(/|$) {
  85.                fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  86.  
  87.                 fastcgi_pass    backendrutorrent;
  88.                 fastcgi_index   index.php;
  89.                 fastcgi_param   SCRIPT_FILENAME $document_root/rutorrent$fastcgi_script_name;
  90.                 include fastcgi_params;
  91.                 fastcgi_intercept_errors        on;
  92.                 fastcgi_ignore_client_abort     off;
  93.                 fastcgi_connect_timeout         60;
  94.                 fastcgi_send_timeout            180;
  95.                 fastcgi_read_timeout            180;
  96.                 fastcgi_buffer_size             128k;
  97.  
  98.                 fastcgi_buffers                 4       256k;
  99.                 fastcgi_busy_buffers_size       256k;
  100.                 fastcgi_temp_file_write_size    256k;
  101.                        }
  102.                 }
  103.  
  104.        location /RPC2 {
  105.            access_log /var/log/nginx/rutorrent.rpc2.access.log;
  106.            error_log /var/log/nginx/rutorrent.rpc2.error.log;
  107.            include /etc/nginx/scgi_params;
  108.            scgi_pass backendrtorrent;
  109.            }
  110.  
  111.        location / {
  112.         try_files $uri $uri/ =404;
  113.           }
  114.      
  115.        
  116.  
  117.  
  118.         #error_page  404              /404.html;
  119.  
  120.         # redirect server error pages to the static page /50x.html
  121.         #
  122.         error_page   500 502 503 504  /usr/share/nginx/50x.html;
  123.         location = /50x.html {
  124.         }
  125.  
  126.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  127.         #
  128.         #location ~ \.php$ {
  129.         #    proxy_pass   http://127.0.0.1;
  130.         #}
  131.  
  132.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  133.         #
  134.         #location ~ \.php$ {
  135.         #    root           html;
  136.         #    fastcgi_pass   127.0.0.1:9000;
  137.         #    fastcgi_index  index.php;
  138.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
  139.         #    include        fastcgi_params;
  140.         #}
  141.  
  142.         # deny access to .htaccess files, if Apache's document root
  143.         # concurs with nginx's one
  144.         #
  145.         #location ~ /\.ht {
  146.         #    deny  all;
  147.         #}
  148.     }
  149.  
  150.  
  151.     # another virtual host using mix of IP-, name-, and port-based configuration
  152.     #
  153.     #server {
  154.     #    listen       8000;
  155.     #    listen       somename:8080;
  156.     #    server_name  somename  alias  another.alias;
  157.  
  158.     #    location / {
  159.     #        root   html;
  160.     #        index  index.html index.htm;
  161.     #    }
  162.     #}
  163.  
  164.  
  165.     # HTTPS server
  166.     #
  167.     #server {
  168.     #    listen       443 ssl;
  169.     #    server_name  localhost;
  170.  
  171.     #    ssl_certificate      cert.pem;
  172.     #    ssl_certificate_key  cert.key;
  173.  
  174.     #    ssl_session_cache    shared:SSL:1m;
  175.     #    ssl_session_timeout  5m;
  176.  
  177.     #    ssl_ciphers  HIGH:!aNULL:!MD5;
  178.     #    ssl_prefer_server_ciphers  on;
  179.  
  180.     #    location / {
  181.     #        root   html;
  182.     #        index  index.html index.htm;
  183.     #    }
  184.     #}
  185.  
  186. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement