先给大家看看我按照网上写的配置文件,域名是hellovim.org,在dnspod上做了泛解析*.hellovim.org
先给出我按照网上写的配置文件:
代码: 全选
server {
listen 80;
server_name hellovim.org www.hellovim.org wtq.hellovim.org;
#access_log /var/www/access_hellovim.log;
location / {
root /var/www/hellovim.org;
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/hellovim.org/$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
然后现在有两个问题:
1、我可以访问hellovim.org/index.html hellovim.org/test.html
但是对于php文件如hellovim.org/p.php就访问不了。
这些都是根目录下有的。
但是我又可以通过ip路径来访问:http://184.22.140.38/hellovim.org/p.php
刚才对dnspod的泛解析改成了@和www记录,现在hellovim.org可以访问了
2.我的域名做了泛解析,而且配置文件也写了这三个:
server_name hellovim.org http://www.hellovim.org wtq.hellovim.org;
现在www.hellovim.org wtq.hellovim.org可以访问,但是hellovim.org访问不了
希望大家能帮忙看看,谢谢了。