localhost.conf 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. log_format custom '$remote_addr - [$time_iso8601] "$request" $status $body_bytes_sent $request_time "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
  2. types_hash_bucket_size 1024;
  3. server {
  4. listen 1080;
  5. server_name _;
  6. index index.html index.php;
  7. root /var/www/html;
  8. access_log /var/log/nginx/localhost.access.log custom;
  9. error_log /var/log/nginx/localhost.error.log warn;
  10. location / {
  11. index index.html index.htm index.php;
  12. }
  13. location ~ \.php$ {
  14. # 404
  15. try_files $fastcgi_script_name =404;
  16. # default fastcgi_params
  17. include fastcgi_params;
  18. # fastcgi settings
  19. fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
  20. fastcgi_index index.php;
  21. fastcgi_buffers 8 16k;
  22. fastcgi_buffer_size 32k;
  23. # fastcgi params
  24. fastcgi_param DOCUMENT_ROOT $realpath_root;
  25. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  26. #fastcgi_param PHP_ADMIN_VALUE "open_basedir=$base/:/usr/lib/php/:/tmp/";
  27. }
  28. }