Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading swagger UI when flask restplus app deployed to nginx web server #567

Closed
sanfx opened this issue Dec 27, 2018 · 3 comments
Closed

Comments

@sanfx
Copy link

sanfx commented Dec 27, 2018

I wrote REST API gateway using flask-restplus plugin, I tested it locally it work and even the swagger documentation loads normally 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:

Image of Yaktocat

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;
        }
}
@GulaAren
Copy link

GulaAren commented Jan 3, 2019

Hi there
You need to pass /swagger on your nginx configuration.

its gonna be like:

location /swagger {
           proxy_pass http://localhost:8000/swaggerui;
}

@ziirish
Copy link
Collaborator

ziirish commented Mar 27, 2019

Hi,

I think this is a duplicate of #223

@ziirish
Copy link
Collaborator

ziirish commented Mar 27, 2019

I'm now closing this issue.
Please follow discussions in #223

@ziirish ziirish closed this as completed Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants