nginx.conf 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. error_log /var/log/nginx.error.log info;
  2. pid /run/nginx.pid;
  3. worker_processes auto;
  4. worker_cpu_affinity auto;
  5. pcre_jit on;
  6. events {
  7. worker_connections #worker_connections#;
  8. multi_accept on;
  9. use epoll;
  10. }
  11. http {
  12. include /env/share/nginx/conf/mime.types;
  13. default_type application/octet-stream;
  14. access_log /var/log/nginx.access.log combined;
  15. sendfile on;
  16. tcp_nopush on;
  17. keepalive_timeout 60;
  18. charset utf-8;
  19. server_tokens off;
  20. server {
  21. listen 8000;
  22. server_name localhost;
  23. root #public_path#;
  24. index index.php;
  25. location = /favicon.ico {
  26. log_not_found off;
  27. access_log off;
  28. }
  29. location = /robots.txt {
  30. allow all;
  31. log_not_found off;
  32. access_log off;
  33. }
  34. location ~ /\. {
  35. deny all;
  36. }
  37. # WordPress only
  38. location ~* /(?:uploads|files)/.*\.php$ {
  39. deny all;
  40. }
  41. location / {
  42. try_files $uri $uri/ /index.php?$args;
  43. }
  44. location ~ \.php$ {
  45. include /env/share/nginx/conf/fastcgi_params;
  46. fastcgi_intercept_errors on;
  47. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  48. fastcgi_pass unix:/run/php-fpm.sock;
  49. }
  50. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  51. expires max;
  52. log_not_found off;
  53. }
  54. }
  55. }