1

I've searched many results in this site has same title as my question, but I can't find a suit for me, this is my problem : I installed nginx on ubuntu

Everything is ok now, but when I tried to create a new subfolder "for exam /var/www/html" is root and my subfolder is "/var/www/html/test1", and have a index.php file in this folder, I can make it access to "/var/www/html/test1" without "No input file specified" error by adding new location /test1 in "/etc/nginx/site-avaiable-default",

But what happend when I want to add 2 or 3 new subfolders?

Test2, Test3, Test4.

So I have to open "default" file again and add "location /test$" for each subfolder, this way is not a flexible way. How can handle it in global, it mean that when I create a new subfolder and I don't want to get "No input file specified" any more?

This is my 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;
 }

}

In This exam "drupal" is my subdirectory

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

Is there any way to create new drupal1, test1, blabla, without do something like this

Thank you so much.

1
  • Please edit your question and add complete nginx configuration. Dec 20, 2014 at 17:58

0

You must log in to answer this question.

Browse other questions tagged .