Skip to content
Snippets Groups Projects
Commit 5a1431a9 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

oups

parent ba57e2d1
No related branches found
No related tags found
1 merge request!997ci(notifications): fix sse stream closed by pwa and haproxy
......@@ -78,7 +78,7 @@ server {
set $prerender 0;
}
# resolver is needed by nginx to resolve proxy_pass url with variable (https://stackoverflow.com/questions/57937222/502-bad-gateway-nginx-no-resolver-defined-to-resolve )
resolver dns-default.openshift-dns.svc.cluster.local;
resolver dns-default.openshift-dns.svc.cluster.local;
if ($prerender = 1) {
# Add $request_uri to avoid error nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except"
# (proxy_pass in if clause is not recommanded, but don't kwnow other way in our case to redirect to a backend ; cf. https://www.f5.com/fr_fr/company/blog/nginx/avoiding-top-10-nginx-configuration-mistakes#if , https://stackoverflow.com/a/10634915 )
......@@ -90,6 +90,23 @@ server {
try_files $uri $uri/ /index.html;
}
## SSE conf
location /api/notification/stream {
add_header X-Debug-SSE-Config Active; # debug
proxy_pass http://res-server-service:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
gzip off;
chunked_transfer_encoding on;
add_header Cache-Control no-cache;
add_header Content-Type text/event-stream;
}
location /api {
proxy_pass http://res-server-service:3000;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment