-
Hello. I'm trying to add GraphQL subscriptions to my actix server. I've got everything set up, subscription endpoint with juniper_actix, etc. But I'm getting a I can see that this message comes from within actix_http: actix-web/actix-http/src/ws/mod.rs Line 171 in 7b27493 Request headers:
Response headers:
Any ideas what might be causing it? I'm completely mystified and not sure how I can debug this |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I found that my nginx proxy was scrapping my original location / {
proxy_pass https://api_server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
+
+ location /subscriptions {
+ proxy_pass https://api_server/subscriptions;
+
+ proxy_http_version 1.1;
+
+ proxy_set_header Host $host:${API_PORT};
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ proxy_set_header Connection "keep-alive, Upgrade";
+ proxy_set_header Upgrade websocket;
+ }
} |
Beta Was this translation helpful? Give feedback.
I found that my nginx proxy was scrapping my original
Connection
andUpgrade
headers. So my solution for now, at least until I find a better one, is to have nginx reset the headers as close as possible to what the client originally sent: