Ngnix 未知指令

Ngnix 未知指令

在 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;

相关内容