Advertisement
lemb

PHP-FPM nginx.conf (display error)

Feb 20th, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. user nginx;
  2. worker_processes 1;
  3.  
  4. error_log /var/log/nginx/error.log warn;
  5. pid /var/run/nginx.pid;
  6.  
  7. events {
  8. worker_connections 1024;
  9. }
  10.  
  11. http {
  12. include /etc/nginx/mime.types;
  13. default_type application/octet-stream;
  14.  
  15. access_log /var/log/nginx/access.log;
  16.  
  17. sendfile on;
  18. tcp_nopush on;
  19. keepalive_timeout 65;
  20.  
  21. gzip on;
  22. gzip_min_length 1100;
  23. gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  24. gzip_proxied any;
  25. gzip_comp_level 4;
  26. gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  27. gzip_vary on;
  28.  
  29. server {
  30. listen 80;
  31. listen 443 ssl spdy;
  32. server_name .dev;
  33.  
  34. ssl_certificate /etc/ssl/certs/lemb.tk.pem;
  35. ssl_certificate_key /etc/ssl/private/lemb.tk.key;
  36.  
  37. spdy_headers_comp 5;
  38.  
  39. set $basepath "/www";
  40. set $domain $host;
  41.  
  42. if ($domain ~ "^(.*)\.dev$") {
  43. set $domain $1;
  44. }
  45.  
  46. set $rootpath "${domain}";
  47.  
  48. set $rootpath "${domain}/public_html";
  49.  
  50. root $basepath/$rootpath;
  51.  
  52. index index.php index.html;
  53.  
  54. location / {
  55. index index.php;
  56. error_page 404 = @indexphp;
  57. }
  58.  
  59. location @indexphp {
  60. rewrite ^(.*)$ /index.php$1;
  61. }
  62.  
  63. location ~ ^(.+\.php)(?:/.+)?$ {
  64. expires off;
  65. fastcgi_pass unix:/var/run/php5-fpm.sock;
  66. fastcgi_index index.php;
  67. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  68. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  69. include fastcgi_params;
  70. }
  71.  
  72. try_files $uri $uri/ /index.php?$args;
  73.  
  74. charset utf-8;
  75.  
  76. location ~ /\.ht {
  77. deny all;
  78. }
  79. }
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement