I have an esp32-cam video stream which pushes to a local IP address From the tech docs this format is mjpeg. The camera code is generated by platformio in vs code using espidf I can view this video on both chrome and Firefox locally. I wanted to stream this to an existing https domain which uses nginx. I added a websocket proxy pass from https://<my_domain>:443 to the local IP address I can view this video on my website with Firefox , no problem. However on Chrome and Edge i get the error "431 (Request Header Fields Too Large)" Printed below is the raw request headers from Chrome developer I have tried all the fixes i can find on the web. i.e. Clear cookies. The Referrer URL seems short to me Would anyone be able to throw light on this problem.
typeGET / HTTP/1.1
Accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Host: <my_domain>:443
Pragma: no-cache
Referer: https://<my_domain>/
Sec-Fetch-Dest: image
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-site
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux" here
I have tried changing the https port. I have used both jquery and pure javascript to render the video on my web page I have tried embedding the video src directly in HTML I have checked on wire shark to see if i can spot any anomalies
all with the same result. I am a beginner programmer and am stymied at this stage
My nginx redirect code is:
# redirect WebSockets
location / {
proxy_pass http://192.168.1.69:80/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host ,my_domain>;
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;
}