Hi All
I am trying to use proxy_pass API via location direction as shown below but it does not work in browser (error log says no such file ). But if proxy_pass API is called via root location / it work. Even curl -i seems ok (shown below ) . Please help it out where I am goin wrong .
config code for location
#################
location /customer1 {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.10.10.7:8080/;
}
Output curl -i
[root~]# curl -i 10.10.10.3/customer1
HTTP/1.1 200 OK
Server: openresty/1.11.2.5
Date: Sat, 14 Oct 2017 21:01:36 GMT
Content-Type: text/html
Content-Length: 519
Connection: keep-alive
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Last-Modified: Thu, 08 Jun 2017 19:42:36 GMT
ETag: "207-551780e00a56c"
Accept-Ranges: bytes
Vary: Accept-Encoding
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>nGenius Redirect</title>
<script type="text/_javascript_">
function launchSplash()
{
var newPath = "/common/NSLogin.jsp?redirect=/console";
var host = document.location.host;
var protocol = document.location.protocol + "//";
var splashURL = protocol + host + newPath;
return splashURL;
}
var website = launchSplash();
window.location = website;
</script>
</head>
<body>
</body>
</html>
##### error.log #############
2017/10/14 17:11:59 [error] 7821#7821: *33531 open() "/usr/local/openresty/nginx/html/common/NSLogin.jsp" failed (2: No such file or directory), client: 10.10.10.1, server: localhost, request: "GET /common/NSLogin.jsp?redirect=/console HTTP/1.1", host: "10.10.10.3", referrer: "http://10.10.10.3/customer1"
2017/10/14 17:11:59 [error] 7821#7821: *33531 open() "/usr/local/openresty/nginx/html/common/NSLogin.jsp" failed (2: No such file or directory), client: 10.10.10.1, server: localhost, request: "GET /common/NSLogin.jsp?redirect=/console HTTP/1.1", host: "10.10.10.3", referrer: "http://10.10.10.3/customer1"
2017/10/14 17:11:59 [error] 7821#7821: *33531 open() "/usr/local/openresty/nginx/html/common/NSLogin.jsp" failed (2: No such file or directory), client: 10.10.10.1, server: localhost, request: "GET /common/NSLogin.jsp?redirect=/console HTTP/1.1", host: "10.10.10.3", referrer: "http://10.10.10.3/customer1"