简体   繁体   English

使用HTTP到端口80的GET请求导致连接重置或服务器无响应

[英]GET request with HTTP to port 80 results in connection reset or no response from server

I have a strange issue that the SSL connection for port 443 on my server is working fine, but when I look for the HTTP variant of my server it gives me the 'Site can't be reached connection was reset' error. 我有一个奇怪的问题,服务器上端口443的SSL连接工作正常,但是当我寻找服务器的HTTP变体时,它提示我“无法到达站点,连接已重置”错误。

I have the following rules in my iptables: 我的iptables有以下规则:

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT

The apache access_log does show an incomming request when requesting the site via HTTP, and the error_log does not show any errors 通过HTTP请求站点时,apache access_log确实显示了传入请求,并且error_log不显示任何错误

In my httpd.conf file I have: 在我的httpd.conf文件中,我有:

Listen 80

My intention was to let all traffic go via HTTPS, so I have 我的意图是让所有流量都通过HTTPS传输,所以我有

<VirtualHost *:80>
    ServerName www.example.com
    Redirect / https://www.example.com
</VirtualHost>

However, it does not matter if I place this last block here or comment it - the server is not reachable via HTTP. 但是,无论我在此处放置最后一个块还是对其进行注释都没有关系-无法通过HTTP访问服务器。 I am on CentOS 6.7. 我使用的是CentOS 6.7。

Edit: 编辑:

When I do curl http://example.com , it returns cURL (52) Empty reply from server 当我curl http://example.com ,它返回cURL (52) Empty reply from server

However, when I check the apache http access_log for that cURL request, it returns 但是,当我检查该cURL请求的apache http access_log时,它返回

xxx.xxx.xxx.xx - - [02/Jun/2016:22:46:06 +0200] "GET / HTTP/1.1" 302 314 "-" 

Which indicates that I should have received a HTTP response status 302 Found code as intended. 这表明我应该已经按预期收到了HTTP响应状态302 Found代码。 However, I received nothing. 但是,我什么也没收到。

Any help or suggestions are welcome 欢迎任何帮助或建议

Solved it. 解决了。 Apparantly there was another firewall on a higher level than the one on my server that was causing the problems. 显然,存在比导致该问题的服务器更高的防火墙级别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM