Nginx 软件安装在子目录中

Nginx 软件安装在子目录中

我想创建一个这样的目录/网站结构:

/
/index.php
/tac
/tac/1app1/index.php
/tac/1app2/
/tac/1app3/

因此,根目录中有一个 CMS。
子目录中应该还有其他 CMS/Web 应用程序。

我该如何更改配置才能让子目录与不同的 Web 应用程序协同工作?

server {
server_name domain.com;
root /var/www/domain.com;

access_log /var/log/nginx/domain.com_access.log;
error_log /var/log/nginx/domain.com_error.log;

location ~ \..*/.*\.php$ {
    return 403;
}
location ~ /\. {
    deny all;
    access_log off;
    log_not_found off;
}
location ~ ^/tac/(.+\.*)$ {
    alias /var/www/domain.com/tac/$1;
    try_files $uri /index.php$is_args$args;

    # try_files $uri;
    allow all;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    fastcgi_read_timeout 150;
    fastcgi_intercept_errors on;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
}
location / {
    try_files $uri @rewrite;
}
location @rewrite {
    rewrite ^ /index.php;
}
location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    fastcgi_read_timeout 150;
    fastcgi_intercept_errors on;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}

目前我收到此错误:FastCGI sent in stderr: "Access to the script '/var/www/domain.com/tac/1app1/index.php/s/dashboard' has been denied (see security.limit_extensions)" while reading response header from upstream 并且已更改security.limit_extensions为接受所有内容,但问题仍然存在。
因此,我认为问题出在index.php/s/dashboard扩展名无效或找不到文件(当然不是,应该将参数传递给 index.php 脚本,但 Nginx 似乎没有这样做?

相关内容