EC2 Micro 与 NGINX

EC2 Micro 与 NGINX

我有一台运行 Ubuntu 12.04 的 EC2 Micro。我已为其分配了一个 EIP(23.21.213.236),并将我的域名 A 记录指向此 IP。

我尝试访问的域名是 utoolsandfixings.co.uk,这应该显示一个页面,提示“找到服务器”。

完成所有修改后,我尝试重新启动 NGINX。

我已经在服务器上安装了 NGINX,并设置了 VHost、设置了符号链接等。VHOST 如下:

server {
    listen 80; ## listen for ipv4
    server_name utoolsandfixings.co.uk; ## change this to your own domain name
    # I find it really useful for each domain & subdomain to have its own error and access log
    error_log /var/log/nginx/utoolsandfixings.co.uk.error.log;
    access_log /var/log/nginx/utoolsandfixings.co.uk.access.log;
    location / {
            # Change this to the folder where you want to store your website
            root /var/www/utoolsandfixings.co.uk/;
            index index.html index.htm index.php;
    }
    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
            root /var/www/nginx-default;
    }
    # We haven't setup FastCGI yet, but lets configure this now anyways
    #
    # 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;
            # again, change the directory here to your website's root directory make sure to leave $fastcgi_script_name; on the end!
            fastcgi_param SCRIPT_FILENAME /home/meltingice_net/public_html$fastcgi_script_name;
            include /etc/nginx/fastcgi_params;
    }

}

还有我的 nginx.conf

user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
    worker_connections 1024;
    # multi_accept on;
}
http {
    include /etc/nginx/mime.types;
    access_log /var/log/nginx/access.log;
    sendfile on;
    #tcp_nopush on; keepalive_timeout 0;
    keepalive_timeout 2;
    tcp_nodelay on;
    gzip on;
    gzip_disable msie6;
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

如能提供任何帮助我将非常感激。

答案1

NGINX 是否在实例上运行(启动)?/etc/init.d/nginx status

怀疑这是防火墙问题,您是否为允许 HTTP 的实例分配了安全组?有一个合理的指南这里

此外,您是否检查过实例上没有本地防火墙丢弃传入流量?sudo iptables --list

相关内容