简体   繁体   中英

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.

I have the following rules in my 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

In my httpd.conf file I have:

Listen 80

My intention was to let all traffic go via HTTPS, so I have

<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. I am on CentOS 6.7.

Edit:

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

However, when I check the apache http access_log for that cURL request, it returns

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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