Skip to content

[🐛 Bug]: Unexpected token '<', "<!DOCTYPE "... is not valid JSON unable to connect websocket on port forwarding and via Go Teleport #2728

Answered by sevaho
sevaho asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks a lot @talboren for hopping on a call and helping me out!!

The solution was to move the nginx rewrite inside a location block:

        location ~ ^/v2(/|$)(.*) {
            rewrite ^/v2/(.*)$ /$1 break; # <--------
            proxy_pass http://keep-backend:8080;
            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;
        }

Thus for anyone seeing this issue, and wanting to deploy keephq/keep behind a 'single' nginx instance so it can be used when doing kubectl port-forward or when you are using 'Go Teleport' here…

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shahargl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Bug Something isn't working Provider Providers related issues
3 participants
Converted from issue

This discussion was converted from issue #2703 on December 02, 2024 15:01.