CSF UI problems while coming from a proxy (EASY FIX PROPOSAL!)

This forum is only for reproducible bugs with csf and lfd (i.e. not iptables problems, lack of understanding how to use a feature, etc). Posts must be accompanied with full technical details of the problem and how it can be recreated. Any posts not adhering to this, or not considered bugs, will be moved to the General Discussion (csf) forum.
Post Reply
Junior Member
Posts: 1
Joined: 20 Sep 2023, 15:15

CSF UI problems while coming from a proxy (EASY FIX PROPOSAL!)

Post by feanorknd »

Hi there,

when trying to access to UI from an nginx proxy, I have these weird error lines:
2023/09/20 15:43:20 [error] 2333492#2333492: *687017 upstream sent invalid header: "<!DOCTYPE\x20..." while reading response header from upstream
problem was located in line 9876 of lfd.pl:

Code: Select all

                                                print "HTTP/1.0 200 OK\r\n";
                                                print "<!DOCTYPE html>\n";
                                                print "Content-type: text/html\r\n";
                                                print "\r\n";
                                                print "<HTML>\n<TITLE>ConfigServer Security & Firewall</TITLE>\n<BODY style='font-family:Arial, Helvetica, sans-serif;' onload='document.getElementById(\"user\").focus()'>\n";
That 'print "<!DOCTYPE html>\n";' line should be added just before 'print "<HTML>'...

You are adding that line between HTTP headers, and this way, it will cause errors with strict upper layers...

Just comment that '<!DOCTYPE html>\n' line or place it just after 'print "\r\n";' line... this way it should be perfect!


PD: congrats for your excellent work and tool.
Post Reply