![Ngnix 未知指令](https://linux22.com/image/689051/Ngnix%20%E6%9C%AA%E7%9F%A5%E6%8C%87%E4%BB%A4.png)
在 Amazon EC2 上使用 Ubuntu。重新启动服务器时收到此错误消息:
unknown directive "ec2-54-201-86-229.us-west-2.compute.amazonaws.com" in /etc/nginx/conf.d/default.conf:3
我按照以下说明安装 wordpress:
http://theartofcode.tv/installing-wordpress-on-ec2/
我的 default.conf 文件是
server {
## Your website name goes here.
ec2-54-201-86-229.us-west-2.compute.amazonaws.com;
## Your only path reference.
root /var/www/;
listen 80;
## This should be in your http block and if it is, it's not needed here.
index index.html index.htm index.php;
include conf.d/drop;
location / {
# This is cool because no php is touched for static content
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_buffers 8 256k;
fastcgi_buffer_size 128k;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
}
location ~* \.(css|js|png|jpg|jpeg|gif|ico)$ {
expires 1d;
}
}
请注意我是个完全的菜鸟!以上有什么想法吗?
答案1
您需要server_name
在您的网站名称前添加指令:
server_name ec2-54-201-86-229.us-west-2.compute.amazonaws.com;