Nginx PHP 配置模板

server {
    listen 80;
    root /var/www/www.example.com;
    # Add index.php to the list if you are using PHP
    index index.html index.htm index.php index.nginx-debian.html;

    server_name www.example.com;

    client_max_body_size 20m;

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

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

        # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }
}

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注