无法从localhost之外打到nginx

我是一个nginx的新手,我想要做的是设置nginx,并能够使用它作为我的networking服务器。

我现在面临的问题是,当我尝试访问Nginx正在侦听的IP或域名时,我得到'连接超时'。 另一方面,如果我ssh到我的服务器,然后做curl或wget在相同的IP或域我得到一个答复,它打算什么。

基本上我可以在本地打nginx,但不是全局的。 是否有任何权限丢失,或者我应该在configuration中使用除nginx以外的其他用户?

我试图禁用Apache服务器并运行nginx并听所有80仍存在相同的问题

我的nginx设置如下:

####################################################################### # # This is the main Nginx configuration file. # # More information about the configuration options is available on # * the English wiki - http://wiki.nginx.org/Main # * the Russian documentation - http://sysoev.ru/nginx/ # ####################################################################### #---------------------------------------------------------------------- # Main Module - directives that cover basic functionality # # http://wiki.nginx.org/NginxHttpMainModule # #---------------------------------------------------------------------- user nginx; worker_processes 1; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; pid /var/run/nginx.pid; #---------------------------------------------------------------------- # Events Module # # http://wiki.nginx.org/NginxHttpEventsModule # #---------------------------------------------------------------------- events { worker_connections 1024; #---------------------------------------------------------------------- # HTTP Core Module # # http://wiki.nginx.org/NginxHttpCoreModule # #---------------------------------------------------------------------- http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; # Load config files from the /etc/nginx/conf.d directory include /etc/nginx/conf.d/*.conf; # # The default server # server { listen 69.162.77.106:80; server_name warstarz.com; #charset koi8-r; #access_log logs/host.access.log main; location / { root /var/www/warstarz.com/html/; index index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } } 

有可能是您通过错误的URL访问它。

您在NGINXconfiguration中引用的域名可以parsing为

 % dig warstarz.com +short 69.162.77.100 

因此与您的服务器正在侦听的IP地址不匹配。

NMAP报告在69.162.77.106:80监听的A​​pache httpd。

validationNGINX正在运行,并用psnetstat监听正确的IP和端口。

在fuero答案的帮助下,我改变了我正在使用的IP到另一个完全不同的我得到它的工作,后来我觉得我使用的IP不是在我的IP表中,我添加了,但现在运行起来。

谢谢