[Invalid] Different behaviour when downloading from localhost or external ip

Added by MaurizioB over 4 years ago

I've setup lighttpd a couple of days ago, tested locally and working perfectly.
Today I asked a friend of mine to check on my work and we realized that image are not downloaded correctly (while text/html is). It looks like the same happens for plain text files, which are downloaded as "encoded".
It turns out that if I download the files locally, using or localhost, everything works fine; if I use my external ip (both from my local network and from any external computer), everything except html files is scrambled.

This is my actual lighttpd.conf file:

I tried disabling fastcgi.server, disabling the rewrite rules, I checked both files with md5 and sha256, tried different file types, with different browser, disabling cache, using curl and wget. Also file sizes match, I checked the headers (curl outputs: and the error.log (, I disabled the external firewall on my router, tested with another server (cherokee, which doesn't show this issue, as far as I can tell).

Maybe I'm just doing something (really stupid and) wrong, you never know. I'm attaching the 2 files downloaded with curl.

Does anybody have a suggestion, please?

Thank you in advance,

external.png (77.4 KB) external.png test.png downloaded using the external ip
internal.png (77.4 KB) internal.png same file downloaded using localhost/