[alibaba/tengine]配置多个 server 时,$document_root 不能全部生效

2024-05-15 677 views
3

系统: redhat 8 版本: tengine-2.3.2

配置多个 server 时,$document_root 不能全部生效

server {
    listen       80;
    server_name  a.com;

    root   /var/www/a.com/public;
    location / {
        index  index.php index.html index.htm;
        if (!-e $request_filename) {
            rewrite ^/(.*)  /index.php?$1 last;
        }
    }

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

回答

6

setenforce 0 就可以了