标签 php 下的文章

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;
  }
}

server {
  listen 80;
  server_name luntan;
  root /var/www/html;
  index index.php index.html;

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

  location ~ \.php$ {
    fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }

  location ~ /\.ht {
    deny all;
  }
}