Nginx服务器配置,动态更改位置块

时间:2016-08-29 11:43:55

标签: wordpress nginx server

server {
        listen 80;
        listen [::]:80;

        server_name domain.com;

        root /var/www/html/try;
        index index.html index.php;

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

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                include fastcgi_params;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                fastcgi_param SCRIPT_FILENAME /var/www/html/try$fastcgi_script_name;
        }
}

上面的代码一切正常,我想动态更改try_files,就像

一样
try_files $uri $uri/ /package/mhshohel5/index.php?$args;

try_files $uri $uri/ /package/*/index.php?$args;
  • 表示可更改的目录,有没有办法实现。

任何帮助都会很明显。

0 个答案:

没有答案