【发布时间】:2014-02-05 11:37:52
【问题描述】:
在我的配置中,我使用主机名($host)作为目录,所以我不需要为配置中的每个域创建一个条目(仅用于开发目的)
一个问题是 try_files 失败了我尝试了不同的方法,但都没有成功。
- try_files html\$host$uri =404;
- try_files $document_root\$host$uri =404;
- try_files $uri =404;
-
try_files $document_root\$host$fastcgi_script_name =404;
server { listen 80; server_name default; charset UTF-8; #access_log logs/host.access.log main; # redirect server error pages to the static pages error_page 500 502 503 504 /error/50x.html; error_page 404 = /error/404.html; error_page 403 = /error/403.html; location ^~ /error/ { internal; root html/default; } location / { root html/$host; index index.php index.html index.htm; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { #try_files html\$host$uri =404; #try_files $document_root\$host$uri =404; #try_files $uri =404; #try_files $document_root\$host$fastcgi_script_name =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root\$host$fastcgi_script_name; include fastcgi_params; }
【问题讨论】:
标签: web-services nginx fastcgi