Hello again
I recently discovered an interesting problem and I'd like to share that with you and get your opinion on it before I file a bug report.
Summary: nginx does not return a 404 error when requesting a non-existing static file with a trailing slash in the URL for files larger than 1023 bytes
Steps to reproduce:
Now perform the following tests:
Note:
Workaround:
Pretty interesting behaviour, eh? I'm trying to figure out where this 1024 byte limit originates from but maybe somebody of you has a smart idea....?
I recently discovered an interesting problem and I'd like to share that with you and get your opinion on it before I file a bug report.
Summary: nginx does not return a 404 error when requesting a non-existing static file with a trailing slash in the URL for files larger than 1023 bytes
Steps to reproduce:
- Install CentOS 7 64bit, standard installation, all updates applied
- Install Plesk Obsidian using the one-click installer with default settings (wget -O - https://autoinstall.plesk.com/one-click-installer | sh)
- Log in to Plesk and create a hosting for a domain. Do not change anything else.
- Create two files in the httpdocs folder, one of 1023 bytes size and one of 1024 bytes size:
tr -dc A-Za-z0-9 </dev/urandom | head -c 1023 >1023.html
tr -dc A-Za-z0-9 </dev/urandom | head -c 1024 >1024.html
Now perform the following tests:
- Load the URL: => Content of the file is shown as expected
- Load the same URL with a trailing slash: => 404 not found page is shown, as expected
- Load the URL: => Content of the file is shown as expected
- Load the same URL with a trailing slash: => Content of the file is shown, HTTP status code 200 instead of 404
Note:
- You can add any path after the trailing slash (like ), it will always return a HTTP status code of 200 and the content of the file instead of the 404 error page.
- If I bypass nginx (curl https://domain.tld:7081/1024.html/ then I get the correct answer (404 error)
Workaround:
- Disable "Smart static files processing" in "Apache & nginx settings" then the behaviour is as expected (404 error) when loading the URL with the trailing slash for the 1024 byte file.
Pretty interesting behaviour, eh? I'm trying to figure out where this 1024 byte limit originates from but maybe somebody of you has a smart idea....?