NGINX:NGINX别名上没有指定输入文件

时间:2016-05-23 11:00:36

标签: php nginx fastcgi

我想为属于www.example.org/app的所有URI创建一个别名,该别名应引用/var/www/htdocs/app/page/

start.php应该是索引页面。

我有这个文件结构:

/var/www/htdocs/
/var/www/htdocs/app
/var/www/htdocs/app/page
/var/www/htdocs/app/page/start.php

现在我得到了一个像这样的nginx.conf:

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

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
       access_log off; log_not_found off; expires max;
}

location /app {
alias /var/www/htdocs/app/page/;
      location ~ \.php$ {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
                return 404;
        }

        include fastcgi.conf;
        fastcgi_index start.php;
#       fastcgi_pass phpcgi;
        fastcgi_pass unix:/var/www/htdocs/conf/sockets/nginx-php-fcgi.sock;

      }
}

不幸的是,当我尝试打开No input file specified.时,我收到了example.org/app。如果我打开example.org/app/robots.txt没有问题,则会显示robots.txt。

我该如何解决?

0 个答案:

没有答案