Aws CLoudfront not returning the error code returned by origin server, instead it retuning the different error code.
Here my origin server is AWS elb and i have configured all the paths(*) to elb origin in behaviour section of cloudfront.
When i hit http://xxxx.cloufront.net/path1
i am getting 404, and i am getting 401 when i hit same url directly on elb (http://elburl/path1
)
401 is expected because the app (behind elb) expects auth header and since the header not there so it returns 401
For the above request, I can see the 401 error code in elb log and 404 error code in cloudfront log, which means elb returns 401 (returned by app)
Note: I didn't configured any custom error page in cloudfront.
/
or empty. – Varun Chandak