【发布时间】:2016-11-02 14:08:37
【问题描述】:
我有一个使用 ngnix 的服务器,我有一个配置文件:
server {
listen 80;
server_name http://mycoolwebsite.com/;
return 301 http://www.mycoolwebsite.com$request_uri;
}
server {
listen 80;
root /var/www/website/front/public;
index index.php index.html index.htm;
server_name www.mycoolwebsite.com;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
现在当我输入http://www.mycoolwebsite.com 时,网站显示正常。每当我输入http://mycoolwebsite.com 时,我都会得到:
无法访问此站点 |找不到服务器 DNS 地址。
这可能是什么问题?
【问题讨论】: