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

启用SSL证书与Cloudflare后WordPress的cURL及SMTP故障求助

Hey Davis, let's walk through how to troubleshoot these issues step by step—since all your problems popped up after enabling SSL and Cloudflare, they're almost certainly linked to DNS routing, Cloudflare proxy settings, or server network config. Here's where to start:

1. Fix DNS Resolution First (This is the Root Cause)

Your curl -v https://mydomain.info returning Could not resolve host tells me your server can't look up your domain at all—this directly breaks SMTP connections (Mailgun needs DNS to find its servers) and plugin installs (WordPress relies on DNS to reach the plugin repository).

  • Check your server's local DNS config: Open /etc/resolv.conf and make sure it uses reliable DNS servers (like Cloudflare's 1.1.1.1/1.0.0.1 or Google's 8.8.8.8). Don't just rely on your hosting provider's default DNS if it's flaky.
  • Test resolving a third-party domain: Run curl -v smtp.mailgun.org on your server. If this also fails, your server's entire DNS setup is broken—not just your domain.
  • Verify Cloudflare DNS status: Head to your Cloudflare dashboard, check that your A/AAAA records point to your server's correct public IP. If you're using Cloudflare's proxy (orange cloud icon), wait for DNS propagation to finish (use dig mydomain.info on your local machine and server to compare results).
2. Check Cloudflare SSL + Nginx Configuration

Mismatched SSL settings between Cloudflare and Nginx often cause hidden network issues:

  • Set Cloudflare's SSL mode to Full or Full (Strict). Avoid "Flexible" mode—it creates an unencrypted connection between Cloudflare and your server, which can trigger weird routing errors.
  • Validate Nginx's SSL setup: Make sure Nginx is listening on port 443, has a valid SSL certificate (either Cloudflare's Origin CA cert or your own), and the server_name matches your domain. Test local access with curl -v https://localhost or curl -v https://[your-server-ip]—if this returns HTML, Nginx is working fine, and the issue is external.
3. Troubleshoot Mailgun SMTP Errors

Once DNS is fixed, if SMTP still fails:

  • Use the right Mailgun ports: Stick to 587 (TLS) or 465 (SSL)—port 25 is often blocked by hosting providers or firewalls.
  • Verify iptables outbound rules: From your iptables details, ensure your server allows outbound traffic on ports 587/465. SMTP requires your server to initiate a connection to Mailgun, so blocked outbound ports will kill the connection.
  • Test connectivity directly: Run telnet smtp.mailgun.org 587 on your server. If you get a connection response, the network path is good—double-check your WordPress SMTP plugin settings (username, password, port).
4. Debug Plugin Installation Failures

Since manual uploads work, file permissions aren't the issue—this points to WordPress being blocked from making external requests:

  • Check wp-config.php for proxy settings: If your server is behind a firewall, you might need to add WP_PROXY_HOST and WP_PROXY_PORT to let WordPress reach the plugin repo.
  • Test repo access: Run curl -v https://api.wordpress.org/plugins/info/1.0/ on your server. If you get JSON output, external requests work—if not, it's still a DNS/network block issue.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.29 08:45:12