1
我在網上搜索了很長時間。但沒用。請幫助或嘗試提供一些想法如何實現這一點。 我有一個nginx服務,它有一些項目,當我使用這個配置時,它可以很好地工作。設置nginx默認路徑和路由
#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.
能
別人的幫助我?提前致謝。
您可以指定在執行'localhost/v1'時要執行哪個文件嗎? –