ruslango

nginx_all

Apr 24th, 2012
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name ~^(?:www\.)?(?<domain>.+)$;
  4. root /home/www/$domain;
  5. index index.php;
  6.  
  7. location / {
  8. try_files $uri $uri/ /index.php?q=$uri&$args;
  9. }
  10.  
  11. location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
  12. return 403;
  13. error_page 403 /403_error.html;
  14. }
  15.  
  16. location ~ /\. {
  17. deny all;
  18. access_log off;
  19. log_not_found off;
  20. }
  21.  
  22. location ~* \.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js|gz)$ {
  23. root /home/www/$domain;
  24. access_log off;
  25. expires 30d;
  26. gzip_static on;
  27. }
  28.  
  29. location ~ \.php$ {
  30. fastcgi_pass unix:/var/tmp/joom.sock;
  31. fastcgi_index index.php;
  32. client_max_body_size 30m;
  33. client_body_buffer_size 128k;
  34. fastcgi_cache_min_uses 1;
  35. fastcgi_cache_use_stale error timeout invalid_header http_500;
  36. fastcgi_cache_valid 200 302 304 10m;
  37. fastcgi_cache_valid 301 1h;
  38. fastcgi_cache_valid any 3m;
  39. include /etc/nginx/fastcgi_params;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment