Flask Restplus Swagger Not Loading Behind Nginx Flask Restplus Swagger Not Loading Behind Nginx nginx nginx

Flask Restplus Swagger Not Loading Behind Nginx


The problem was that Nginx did not properly redirect the http requests when trying to get the resources from Swagger (the JSON configuration file in particular).

The issue has been fixed by changing the Nginx configuration as follow:

[...]  # Location for MobyDQ Flask API  location ~ ^/(mobydq|swaggerui) {    limit_req zone=default burst=20;    proxy_pass http://api;    proxy_redirect   off;    proxy_set_header Host $host;    proxy_set_header X-Real-IP $remote_addr;    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_set_header X-Forwarded-Proto $scheme;  }[...]