swagger documenting not loading after deploying the flask app to nginx web server

≡放荡痞女 提交于 2020-01-15 10:27:13

问题


I wrote REST API gateway using flask-restplus plugin, I tested it locally it work using flask run but when I try to run the website on server

it works opens in the browser but swagger documentation doesnt shows up in browser console I can see the below error:

Here is my site nginx configuration: sites-available $ vi clinic_backend

server {
        listen 80 default_server;
        listen [::]:80;

        root /var/www/html;

        server_name example.com;

        location /static {
            alias /var/www/html/static/;
        }

        location / {
            try_files $uri @wsgi;
        }

        location @wsgi {
            proxy_pass http://unix:/tmp/gunicorn.sock;
            include proxy_params;
        }

        location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
            access_log off;
            log_not_found off;
            expires max;
        }
}

来源:https://stackoverflow.com/questions/53934180/swagger-documenting-not-loading-after-deploying-the-flask-app-to-nginx-web-serve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!