server {
    server_name  www.example.com;
    listen 80;
    index index.php;
    root /var/www/blog;

    location / {
    try_files $uri $uri/ /index.php?$query_string;
  }

  location ~ \.php$ {
    #include snippets/fastcgi-php.conf;

    # Nginx php-fpm sock config:
    fastcgi_pass  unix:/run/php/php8.1-fpm.sock;
    #fastcgi_pass  127.0.0.1:9001;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}

标签: nginx, php, php-fpm

添加新评论