nginx lumen

30 阅读1分钟
server {
    listen 80;
    server_name lumen.localhost;  # 替换为你的域名或IP地址
    root /var/www/html/lumen/my-lumen-app/public;  # 替换为你的 Lumen 项目的 public 目录路径

    index index.php;

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

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;  # 替换为你的 PHP-FPM socket 路径
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

}