You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OwnCloud服务器HTTP可访问但HTTPS连接失败求助

Troubleshooting OwnCloud HTTPS ERR_CONNECTION_RESET on Raspberry Pi

Let’s walk through this issue systematically—since your HTTP setup works perfectly and Nginx logs show nothing, the problem is almost certainly happening at the TCP/SSL layer before requests reach Nginx’s application logging, or in network routing. Here’s what to check step by step:

1. Verify Port 443 is Actually Being Listened On

First, confirm Nginx is actively listening for HTTPS connections on port 443. Run this command on your Raspberry Pi:

ss -tulpn | grep 443

You should see a line with nginx listed as the process listening on 0.0.0.0:443 (IPv4) and/or [::]:443 (IPv6). If you don’t see Nginx here:

  • Double-check your Nginx site config for typos in the listen directive (e.g., accidentally writing 433 instead of 443).
  • Make sure you didn’t restrict listening to a specific IP that your client isn’t targeting.

2. Check Firewall & Network Routing Rules

Local Firewall (ufw/iptables)

Raspberry Pi often uses ufw by default. Check if HTTPS traffic is allowed:

sudo ufw status

Look for a rule allowing 443/tcp (or https). If it’s missing, add it:

sudo ufw allow https

If you use iptables directly, run sudo iptables -L -n and ensure the INPUT chain has an ACCEPT rule for port 443.

Router Port Forwarding (If Accessing Externally)

If you’re trying to connect from outside your local network, confirm your router is forwarding port 443 to your Raspberry Pi’s local IP address. A misconfigured port forward (or no forward at all) will cause a connection reset. Also, some ISPs block port 443 on residential connections—you can test this by trying to connect locally first (see step 4).

3. Validate SSL Certificate Configuration

Even if Nginx logs don’t show errors, a broken certificate setup can prevent the server from accepting HTTPS connections. Run this to test your Nginx config and certificate availability:

sudo nginx -t

This will flag issues like:

  • Incorrect paths to your SSL certificate or private key files.
  • Permissions problems (Nginx’s user, usually www-data, can’t read the cert/key files). Fix permissions with:
    sudo chown www-data:www-data /path/to/your/certificate.pem /path/to/your/private.key
    sudo chmod 600 /path/to/your/private.key
    

4. Test Local HTTPS Connection

Eliminate network variables by testing directly on the Raspberry Pi:

  • Use curl to check the local connection:
    curl -v https://localhost
    
  • Or use openssl to debug the SSL handshake:
    openssl s_client -connect localhost:443
    

If this fails, the problem is on the Pi itself (not network-related). If it works, then the issue is with external routing, firewall, or ISP restrictions.

5. Fix Nginx Listen Addresses

Ensure Nginx is listening on both IPv4 and IPv6 (unless you specifically want to block one). Update your site config’s listen directives to:

listen 443 ssl;
listen [::]:443 ssl;

If you only have listen [::]:443 ssl;, IPv4 clients will get a connection reset since the server isn’t listening on their protocol.

6. Adjust SSL Protocol/Cipher Suite Compatibility

Sometimes strict SSL settings can break connections with older clients. Temporarily relax your SSL config to test:

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

Restart Nginx (sudo systemctl restart nginx) and try connecting again. If this works, you can tweak the ciphers to balance security and compatibility later.

Next Steps If Nothing Works

If you’ve gone through all these steps and still have issues, share:

  • Your full Nginx site configuration (redact any sensitive info like domain names or cert paths if needed).
  • The output of sudo nginx -t.
  • The results of the local curl and openssl tests.

That’ll help narrow down the exact cause.

内容的提问来源于stack exchange,提问作者Lest

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:43:36