簡體   English   中英

SonarQube 返回錯誤的網關錯誤

[英]SonarQube Returning Bad Gateway Error

我正在嘗試使用 Caddy 為 SonarQube 提供服務。 我可以查看該站點,但它返回 502 Bad Gateway。 該服務似乎已啟動並正在運行。 也拒絕局部卷曲。

卷曲

curl -I 0.0.0.0:9000
curl: (7) Failed to connect to 0.0.0.0 port 9000: Connection refused

sonar.properties

#--------------------------------------------------------------------------------------------------
# WEB SERVER
# Web server is executed in a dedicated Java process. By default heap size is 512Mb.
# Use the following property to customize JVM options.
#    Recommendations:
#
#    The HotSpot Server VM is recommended. The property -server should be added if server mode
#    is not enabled by default on your environment:
#    http://docs.oracle.com/javase/8/docs/technotes/guides/vm/server-class.html
#
#    Startup can be long if entropy source is short of entropy. Adding
#    -Djava.security.egd=file:/dev/./urandom is an option to resolve the problem.
#    See https://wiki.apache.org/tomcat/HowTo/FasterStartUp#Entropy_Source
#
#sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError

# Same as previous property, but allows to not repeat all other settings like -Xmx
#sonar.web.javaAdditionalOpts=

# Binding IP address. For servers with more than one IP address, this property specifies which
# address will be used for listening on the specified ports.
# By default, ports will be used on all IP addresses associated with the server.
#sonar.web.host=0.0.0.0

# Web context. When set, it must start with forward slash (for example /sonarqube).
# The default value is root context (empty value).
#sonar.web.context=
# TCP port for incoming HTTP connections. Default value is 9000.
#sonar.web.port=9000
sonar.web.https.port=8999

球童檔案

https://....com {
  tls self_signed
  gzip
  proxy /  0.0.0.0:9000
}

http://....com {
  tls off
  gzip
  proxy / 127.0.0.1:9000
}

0.0.0.0不是可路由地址。 服務器將其用作“元地址”,以指定它應該偵聽所有可用地址,而不是僅偵聽一個。 所以服務器可以監聽0.0.0.0 ,但客戶端不能0.0.0.0發出請求 您的 Caddyfile 應如下所示:

https://....com {
  tls self_signed
  gzip
  proxy / 127.0.0.1:9000
}

http://....com {
  tls off
  gzip
  proxy / 127.0.0.1:9000
}

本地 cURL 請求應如下所示: curl 127.0.0.1:9000

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM