Reputation: 3939
I'm using the following in my nginx config to proxy requests for specific paths to a separate static website server.
server {
listen 80;
server_name _ localhost; # need to listen to localhost for worker tier
location / {
proxy_pass https://mywebsite.com;
proxy_set_header Host mywebsite.com;
proxy_set_header X-Real-IP $remote_addr;
}
}
The first time the /team
path is accessed, it works fine. But subsequent requests result in HTTP 426
error in Chrome. Opening this in an incognito window works well but sometimes errors with 426 as well.
There are no errors in nginx error log for this. 426 documentation does not help us in getting anywhere with this.
Nginx is running inside an ElasticBeanstalk environment which uses an application loadbalancer which accepts HTTP / HTTPS requests and forwards them to port 80 of the app instance.
Upvotes: 5
Views: 2880
Reputation: 31
Well it's been some time since the question has been asked but i recently had similar issues and i found this question pretty fast. The solution which has been successful for me was this: https://github.com/envoyproxy/envoy/issues/2506#issuecomment-362558239
I added proxy_http_version 1.1; to the location block:
location / {
proxy_pass https://mywebsite.com;
proxy_http_version 1.1;
proxy_set_header Host mywebsite.com;
proxy_set_header X-Real-IP $remote_addr;
}
Upvotes: 3