nginx-example.conf 906 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. server {
  2. listen 80;
  3. #listen 443 ssl;
  4. #ssl_certificate /etc/nginx/ssl/phproject.crt;
  5. #ssl_certificate_key /etc/nginx/ssl/phproject.key;
  6. root /var/www/phproject;
  7. index index.php;
  8. server_name demo.phproject.org;
  9. # Dynamic URLs
  10. location / {
  11. try_files $uri $uri/ /index.php?$args;
  12. }
  13. # Disable logging of ping requests
  14. location /ping {
  15. access_log off;
  16. try_files $uri $uri/ /index.php?$args;
  17. location ~ \.php$ {
  18. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  19. fastcgi_pass 127.0.0.1:9000;
  20. fastcgi_index index.php;
  21. include fastcgi_params;
  22. }
  23. }
  24. location ~ \.php$ {
  25. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  26. fastcgi_pass 127.0.0.1:9000;
  27. fastcgi_index index.php;
  28. include fastcgi_params;
  29. }
  30. location ~ ^/app/(controller|dict|helper|model|view) {
  31. deny all;
  32. }
  33. location ~ /\.ht {
  34. deny all;
  35. }
  36. location ~ /config\.ini {
  37. deny all;
  38. }
  39. client_max_body_size 64M;
  40. }