NGINX does not serve my images (with extension .jpg or .png) but it serves any other file (e.g. .txt, no extenstion at all).
This is the relevant part in my NGINX-Config:
location /uploads/ {
alias /var/www/uploads/;
autoindex on;
}
When I make a get request to https://myserver.com/uploads/ I get the following listing:
Clicking on test.txt works as expected, but for test.jpg or test.png I receive a 404 Error:
Why's that and how to resolve the error?


Have you checked the file permissions? Maybe image files have different permissions, in that case you can try to set the permissions as the other txt file.
You can try even to add the types directive in your nginx configuration. Here's an example: