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

Eclipse Oxygen中SonarLint插件无法通过HTTPS连接SonarQube服务器

Troubleshooting HTTPS Connection Issues for SonarQube Behind Apache Proxy

It sounds like you've got the basic HTTP connection to SonarQube (port 9000) working smoothly, but hitting a snag when routing traffic through your Apache HTTPS proxy. Let's walk through the most common fixes and checks to get this sorted out:

1. Verify Your Apache Proxy & SSL Configuration

First, double-check that you've enabled all required Apache modules—this is a super common oversight. Run these commands (adjust for your OS if you're not on Debian/Ubuntu):

a2enmod proxy proxy_http ssl
systemctl restart apache2

Next, ensure your HTTPS VirtualHost configuration is set up correctly. Here's a working template to compare against your setup:

<VirtualHost *:443>
    ServerName your-sonar-domain.com
    SSLEngine on
    SSLCertificateFile /path/to/your/public-cert.crt
    SSLCertificateKeyFile /path/to/your/private-key.key

    # Disable forward proxying (we only need reverse proxy functionality)
    ProxyRequests Off
    # Critical: Preserve the original host header so SonarQube recognizes the external domain
    ProxyPreserveHost On

    <Proxy *>
        Require all granted
    </Proxy>

    # Forward all incoming HTTPS requests to SonarQube's local port
    ProxyPass / http://localhost:9000/
    ProxyPassReverse / http://localhost:9000/
</VirtualHost>

The ProxyPreserveHost On line is non-negotiable here—without it, SonarQube will generate internal links using localhost:9000 instead of your HTTPS domain, which causes connection failures.

2. Update SonarQube's Configuration to Recognize the Proxy

Head to your SonarQube installation directory, open conf/sonar.properties, and set these values to match your HTTPS setup:

# Restrict SonarQube to only listen locally (so traffic only comes through Apache)
sonar.web.host=127.0.0.1
# Match the context path in your proxy (use "/" if you're proxying the root domain)
sonar.web.context=/
# Tell SonarQube its external HTTPS endpoint details
sonar.web.externalHost=your-sonar-domain.com
sonar.web.externalPort=443
sonar.web.externalProtocol=https

After making these changes, restart SonarQube to apply the new settings.

3. Check Logs for Clues

If the configuration looks solid, dive into logs to find the root cause:

  • Check Apache's error log (usually /var/log/apache2/error.log or /var/log/httpd/error_log) for entries like connection refusals, SSL certificate errors, or proxy forwarding issues.
  • Look at SonarQube's logs (logs/sonar.log) to see if it's receiving requests from the proxy or throwing errors related to host headers.

If you see proxy: HTTP: disabled connection for (localhost) in Apache's logs, this is likely an SELinux restriction. Fix it with:

setsebool -P httpd_can_network_connect on

4. Test Connectivity Step-by-Step

  • On the Apache server, run curl http://localhost:9000 to confirm SonarQube is running locally without issues.
  • Then test the HTTPS proxy locally with curl -v https://your-sonar-domain.com (use curl -vk if you're using a self-signed certificate to skip validation). Look for any SSL handshake errors or redirect loops.
  • From a client machine, test the HTTPS endpoint to rule out firewall issues—make sure port 443 is open and reachable.

内容的提问来源于stack exchange,提问作者Jean Paul Larach

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.20 11:51:20