0

I have flask app running using blueprint and api object initialised with prefix of api

api = Api(_bp, catch_all_404s=True, prefix="/api", version=0.1,
          title="Clinical record management REST HTTP API's Gateway",
          descrition="REST API gateway for Clinical Record Management.")

and I have setup nginx configuration for my site

location /api {
        root /var/www/html;
        try_files $uri @wsgi;
}

but navigating to location ipAddress/api doesn't work

I get errr saying :

Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
  • I have worked on this problem today. I can't really give a proper and full explanation, but doing `location /api/` instead of `location /api` should solve your problem. – IMCoins Jan 03 '19 at 15:11
  • Thanks @IMCoins I gave it a try now I am getting a different error saying ‘{"message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. You have requested this URI [/api/] but did you mean /api or /static/ ?"}‘ – Ciasto piekarz Jan 03 '19 at 18:45
  • I removed catch_all_404s=True, from my flask app and now I am seeing bad gateway error – Ciasto piekarz Jan 03 '19 at 19:50

0 Answers0