daily pastebin goal
2%
SHARE
TWEET

trevorj-php-nginx

a guest Aug 26th, 2012 12 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user www-data;                                                                                                                                                                                                                                                                                                        
  2. worker_processes 4;
  3. pid /var/run/nginx.pid;
  4.  
  5. events {
  6.     worker_connections 768;
  7.     # multi_accept on;
  8. }
  9.  
  10. server {
  11.     listen   80;
  12.     server_name  localhost;
  13.     access_log  /var/log/nginx/localhost.access.log;
  14.  
  15. ## Default location
  16.     location / {
  17.         root   /var/www;
  18.         index  index.php;
  19.     }
  20.  
  21. ## Images and static content is treated different
  22.     location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  23.       access_log        off;
  24.       expires           30d;
  25.       root /var/www;
  26.     }
  27.  
  28. ## Parse all .php file in the /var/www directory
  29.     location ~ .php$ {
  30.         fastcgi_split_path_info ^(.+\.php)(.*)$;
  31.         fastcgi_pass   backend;
  32.         fastcgi_index  index.php;
  33.         fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
  34.         include fastcgi_params;
  35.         fastcgi_param  QUERY_STRING     $query_string;
  36.         fastcgi_param  REQUEST_METHOD   $request_method;
  37.         fastcgi_param  CONTENT_TYPE     $content_type;
  38.         fastcgi_param  CONTENT_LENGTH   $content_length;
  39.         fastcgi_intercept_errors        on;
  40.         fastcgi_ignore_client_abort     off;
  41.         fastcgi_connect_timeout 60;
  42.         fastcgi_send_timeout 180;
  43.         fastcgi_read_timeout 180;
  44.         fastcgi_buffer_size 128k;
  45.         fastcgi_buffers 4 256k;
  46.         fastcgi_busy_buffers_size 256k;
  47.         fastcgi_temp_file_write_size 256k;
  48.     }
  49.  
  50. ## Disable viewing .htaccess & .htpassword
  51.     location ~ /\.ht {
  52.         deny  all;
  53.     }
  54. }
  55. upstream backend {
  56.         server 127.0.0.1:9000;
  57. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top