The place to get a correct example for the nginx config is in the calibre user manual, the general internet is full of wrong advice.
https://manual.calibre-ebook.com/ser...-other-servers
And I'm afraid I dont have time to help you debug the nginx issue in detail, sorry.