我需要调试一个在 Nginx 反向代理后运行的远程 Java 应用程序。我收到了以下错误信息:
“无法连接到远程调试 VM。原因:java.io.IOException: 收到了无效握手。”
为了实现这一目标,应当正确配置 Nginx。我已经成功地将 VSCode Java 调试器连接到了远程 Java 应用程序,直接定位应用程序的主机。
由于使用了 Nginx Docker 镜像,解析器是 127.0.0.11。
我的 Nginx 配置文件 `app.xyz.com.conf` 在 conf.d 目录下。
感谢您的预先帮助!
“无法连接到远程调试 VM。原因:java.io.IOException: 收到了无效握手。”
为了实现这一目标,应当正确配置 Nginx。我已经成功地将 VSCode Java 调试器连接到了远程 Java 应用程序,直接定位应用程序的主机。
由于使用了 Nginx Docker 镜像,解析器是 127.0.0.11。
我的 Nginx 配置文件 `app.xyz.com.conf` 在 conf.d 目录下。
server {
listen 1043;
resolver 127.0.0.11 valid=30s;
server_name app.xyz.com;
include /etc/nginx/mime.types;
location / {
proxy_buffer_size 8k;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
set $upstream "http://java-app:1043";
proxy_pass $upstream;
client_max_body_size 10M;
}
}
感谢您的预先帮助!