【问题标题】:Oracle UTL_HTTP bad request with ngixx使用 ngixx 的 Oracle UTL_HTTP 错误请求
【发布时间】:2021-07-26 19:22:29
【问题描述】:

我有一个 ngnix 作为下一个条目的反向代理:

 location /jrri/ {
    proxy_pass http://xxx.xxx.xxx.xxx:8080/;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

如果我从网络浏览器或 curl 调用 https://www.mysite.com.ar:443/jrri,我会得到 200 ok 的结果。

curl --head https://www.mysite.com.ar:443/jrri/
HTTP/1.1 200
Server: nginx/1.20.1
Date: Mon, 26 Jul 2021 19:00:54 GMT
Content-Type: text/html;charset=UTF-8
Connection: keep-alive

但如果我从 oracle 程序调用,我会收到错误代码 400 - Bad request

  DECLARE
    l_text VARCHAR2(32767);
    req utl_http.req;
  BEGIN
    UTL_HTTP.SET_WALLET('');
     l_text := UTL_HTTP.REQUEST('https://www.mysite.com.ar:443/jrri/');
    dbms_output.put_line(l_text);
  END;

回复:

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.20.1</center>
</body>
</html>

我的Oracle版本是自治数据库,怎么了?

问候

【问题讨论】:

    标签: oracle nginx utl-http


    【解决方案1】:

    我发现了问题,如果您将端口写入请求中,服务器会返回 bada 请求。 如果我写 UTL_HTTP.REQUEST('https://www.mysite.com.ar/jrri/');没有端口它工作!

    【讨论】:

      猜你喜欢
      • 2014-12-29
      • 2013-12-14
      • 1970-01-01
      • 1970-01-01
      • 2015-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      相关资源
      最近更新 更多