nginx代理背后的Oracle Enterprise Monitor保持无限重定向

nginx代理背后的Oracle Enterprise Monitor保持无限重定向,nginx,nginx-reverse-proxy,oracle-enterprise-manager,Nginx,Nginx Reverse Proxy,Oracle Enterprise Manager,我正在尝试在nginx反向代理之后设置OEM。这是我的nginx配置 location ~* "^/em/(.*)" { add_header X-debug-message "Just for testing" always; proxy_redirect https://em/ https://local.mydomain.com:8080/em/; rewrite ^/em/em/(.*) ^/em/$1 bre

我正在尝试在nginx反向代理之后设置OEM。这是我的nginx配置

 location ~* "^/em/(.*)" {

            add_header X-debug-message "Just for testing" always;

            proxy_redirect https://em/ https://local.mydomain.com:8080/em/;
            rewrite ^/em/em/(.*) ^/em/$1 break;
            proxy_cookie_path ~^(.+)$ "/em; domain=.mydomain.com";

            proxy_pass https://em/em/$1;

        }
以下是前4个页面的请求和响应数据,之后它将继续重定向循环中的最后一个页面

Request URL: https://local.mydomain.com:8080/em/
Request Method: GET
Status Code: 302 Moved Temporarily
Remote Address: 192.168.56.102:8080
Referrer Policy: no-referrer-when-downgrade
Connection: keep-alive
Content-Language: en
Content-Type: text/plain
Date: Thu, 19 Dec 2019 14:48:23 GMT
Location: https://local.mydomain.com:8080/em/em/login.jsp
Server: nginx/1.15.8
Set-Cookie: ORA_SMP_EM_AUTH_27122419296023168200=YFEeoZWcMPfA8gQQ82F0czCIcgA5rumW3-u1gJZ8DZ0W8Zr6Uxpa!371330538; path=/em; domain=.mydomain.com; secure; HttpOnly
Transfer-Encoding: chunked
X-debug-message: Just for testing
X-ORCL-EMOA: true
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,pa;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Cookie: ORA_SMP_EM_AUTH_27122419296023168200=ZY0aWFKYSHRDLT5NpsYrDVJ6lnMQbzAR5LGitj2FDX5zJExGpuFi!371330538; __cfduid=d490c5ed0fba5408abb5ffebaf9e1ad561548864527; _ga=GA1.2.147384809.1548864525
Host: local.mydomain.com:8080
Pragma: no-cache
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36
---------------------------------------------------------------------------------------------------------------------------------
Request URL: https://local.mydomain.com:8080/em/em/login.jsp
Request Method: GET
Status Code: 302 Moved Temporarily
Remote Address: 192.168.56.102:8080
Referrer Policy: no-referrer-when-downgrade
Connection: keep-alive
Content-Language: en
Content-Type: text/html; charset=UTF-8
Date: Thu, 19 Dec 2019 14:48:24 GMT
Location: https://local.mydomain.com:8080/em/em/faces/logon/core-uifwk-console-login
Server: nginx/1.15.8
Transfer-Encoding: chunked
X-debug-message: Just for testing
X-ORACLE-DMS-ECID: 005aWybD0OcE8T0_zxDCiW0001L^000NGP
X-ORCL-EMOA: true
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,pa;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Cookie: ORA_SMP_EM_AUTH_27122419296023168200=YFEeoZWcMPfA8gQQ82F0czCIcgA5rumW3-u1gJZ8DZ0W8Zr6Uxpa!371330538; __cfduid=d490c5ed0fba5408abb5ffebaf9e1ad561548864527; _ga=GA1.2.147384809.1548864525
Host: local.mydomain.com:8080
Pragma: no-cache
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36
---------------------------------------------------------------------------------------------------------------------------------
Request URL: https://local.mydomain.com:8080/em/em/faces/logon/core-uifwk-console-login
Request Method: GET
Status Code: 200 OK
Remote Address: 192.168.56.102:8080
Referrer Policy: no-referrer-when-downgrade
Cache-Control: no-cache
Connection: keep-alive
Content-Encoding: gzip
Content-Language: en
Content-Type: text/html;charset=utf-8
Date: Thu, 19 Dec 2019 14:48:24 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Server: nginx/1.15.8
Transfer-Encoding: chunked
Vary: Accept-Encoding
X-debug-message: Just for testing
X-ORACLE-DMS-ECID: 005aWybE49ZE8T0_zxDCiW0001L^000Ma1
X-ORCL-EMOA: true
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,pa;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Cookie: ORA_SMP_EM_AUTH_27122419296023168200=YFEeoZWcMPfA8gQQ82F0czCIcgA5rumW3-u1gJZ8DZ0W8Zr6Uxpa!371330538; __cfduid=d490c5ed0fba5408abb5ffebaf9e1ad561548864527; _ga=GA1.2.147384809.1548864525
Host: local.mydomain.com:8080
Pragma: no-cache
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36
---------------------------------------------------------------------------------------------------------------------------------
Request URL: https://local.mydomain.com:8080/em/em/faces/logon/core-uifwk-console-login?_afrLoop=5008527327684549&_afrWindowMode=2&Adf-Window-Id=w0
Request Method: GET
Status Code: 200 OK
Remote Address: 192.168.56.102:8080
Referrer Policy: no-referrer-when-downgrade
Cache-Control: no-cache
Connection: keep-alive
Content-Encoding: gzip
Content-Language: en
Content-Type: text/html;charset=utf-8
Date: Thu, 19 Dec 2019 14:48:24 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Server: nginx/1.15.8
Transfer-Encoding: chunked
Vary: Accept-Encoding
X-debug-message: Just for testing
X-ORACLE-DMS-ECID: 005aWybFUTEE8T0_zxDCiW0001L^000Ma2
X-ORCL-EMOA: true
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,pa;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Cookie: ORA_SMP_EM_AUTH_27122419296023168200=YFEeoZWcMPfA8gQQ82F0czCIcgA5rumW3-u1gJZ8DZ0W8Zr6Uxpa!371330538; __cfduid=d490c5ed0fba5408abb5ffebaf9e1ad561548864527; _ga=GA1.2.147384809.1548864525
Host: local.mydomain.com:8080
Pragma: no-cache
Referer: https://local.mydomain.com:8080/em/em/faces/logon/core-uifwk-console-login
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36
_afrLoop: 5008527327684549
_afrWindowMode: 2
Adf-Window-Id: w0
---------------------------------------------------------------------------------------------------------------------------------

当我在没有nginx反向代理的情况下直接调用页面时,它会工作并使用类似的标题。我正在为nginx使用https连接。

您使用的
$1
不明确。您应该在
位置
正则表达式中使用命名捕获。@RichardSmith,谢谢。我会改变的。但是它仍然不能解决我面临的问题。你使用
$1
是不明确的。您应该在
位置
正则表达式中使用命名捕获。@RichardSmith,谢谢。我会改变的。但它仍然不能解决我面临的问题。