2017-03-10 8 views
1

私はネット上で長い時間を探しています。しかし、使用しないでください。これを達成する方法を教えてください。 私はこの設定を使用すると、いくつかのプロジェクトを持って、nginxのseviceを持って、それはうまくいくことができます。デフォルトのパスとルートを設定する

#user nobody; 
worker_processes 1; 

events { 
    worker_connections 1024; 
} 
http { 
    include  mime.types; 
    default_type application/octet-stream; 


sendfile  on; 



keepalive_timeout 65; 

server { 
    listen  80; 
    server_name localhost; 

    #charset koi8-r; 

    #access_log logs/host.access.log main; 
    root   html; 
    ***location /v1/ { 
     alias html/v1/; 
     index index.html index.htm index.php; 
    }*** 
    location /v2/ { 
     alias html/v2/; 
     index index.html index.htm index.php; 
    } 
    location /mch/ { 
     alias html/mch/; 
     index index.html index.htm index.php; 
    } 
    location /user/ { 
     alias html/user/; 
     index index.html index.htm index.php; 
    } 
    location /merchant/ { 
     alias html/merchant/; 
     index index.html index.htm index.php; 
    } 
    error_page 500 502 503 504 /50x.html; 
    location = /50x.html { 
     root html; 
    } 
    location ~ \.php$ { 

     fastcgi_pass 127.0.0.1:9000; 
     fastcgi_index index.php; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     include  fastcgi_params; 
    } 


} 





} 

そして私は、デフォルトのパスは、このような設定変更v1.I設定したい:それは間違って働い

location/{ 
     alias html/v1/; 
     index index.html index.htm index.php; 
    } 

は、このようなエラーが聖霊降臨祭:

No input file specified. 

誰かが助けることができます私は?事前に感謝します。

+0

'localhost/v1'を打つときに実行するファイルを指定できますか? –

答えて

1

No input file specifiedメッセージはPassing Uncontrolled Requests to PHPによって引き起こされます。

あなたはURI /は、リダイレクトを実行、/v1/パスにアクセスする場合:上記の例では

server { 
    listen  80; 
    server_name localhost; 

    root html; 
    index index.html index.htm index.php; 

    location =/{ 
     return 302 /v1/; 
    } 

    error_page 500 502 503 504 /50x.html; 

    location ~ \.php$ { 
     try_files $uri =404; 

     include  fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME $request_filename; 
     fastcgi_pass 127.0.0.1:9000; 
    } 
} 

を、私は、任意の関数を実行していなかったいくつかの場所のブロックを削除しました。

+0

ありがとうございます。 – alphayan

関連する問題