没有指定nginx子文件夹的input文件

我在这个网站search了很多结果与我的问题相同的标题,但我找不到一个西装,这是我的问题:我在Ubuntu上安装nginx

现在一切正常,但是当我试图创build一个新的子文件夹“for exam / var / www / html”是root并且我的子文件夹是“/ var / www / html / test1”,并且在这里有一个index.php文件文件夹中,我可以通过在“/ etc / nginx / site-avaiable-default”中添加新的位置/ test1来访问“/ var / www / html / test1”

但是当我想添加2或3个新的子文件夹时会发生什么?

Test2,Test3,Test4。

所以我必须再次打开“default”文件并为每个子文件夹添加“location / test $”,这种方式不是一种灵活的方式。 如何处理它在全球,这意味着当我创build一个新的子文件夹,我不想得到“没有input文件指定”了?

这是我的configuration

server { server_name localhost; root /var/www/html; ## <-- Your only path reference. index index.html index.php; # Enable compression, this will help if you have for instance advagg module # by serving Gzip versions of the files. gzip_static on; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } # This matters if you use drush prior to 5.x # After 5.x backups are stored outside the Drupal install. #location = /backup { # deny all; #} # Very rarely should these ever be accessed outside of your lan location ~* \.(txt|log)$ { allow 192.168.0.0/16; deny all; } location ~ \..*/.*\.php$ { return 403; } # No no for private location ~ ^/sites/.*/private/ { return 403; } # Block access to "hidden" files and directories whose names begin with a # period. This includes directories used by version control systems such # as Subversion or Git to store control files. location ~ (^|/)\. { return 403; } location / { # This is cool because no php is touched for static content try_files $uri @rewrite; autoindex on; } location /drupal { # This is cool because no php is touched for static content # try_files $uri @rewrite; autoindex on; } location @rewrite { # You have 2 options here # For D7 and above: # Clean URLs are handled in drupal_environment_initialize(). rewrite ^ /index.php; # For Drupal 6 and bwlow: # Some modules enforce no slash (/) at the end of the URL # Else this rewrite block wouldn't be needed (GlobalRedirect) #rewrite ^/(.*)$ /index.php?q=$1; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; fastcgi_pass unix:/var/run/php5-fpm.sock; } # Fighting with Styles? This little gem is amazing. # This is for D6 #location ~ ^/sites/.*/files/imagecache/ { # This is for D7 and D8 location ~ ^/sites/.*/files/styles/ { try_files $uri @rewrite; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } } 

在这个考试中,“drupal”是我的子目录

 location /drupal { # This is cool because no php is touched for static content # try_files $uri @rewrite; autoindex on; } 

有什么办法可以创build新的drupal1,test1,blabla,而不需要做这样的事情

非常感谢。