Answer the question
In order to leave comments, you need to log in
How to configure access to swagger.json by domain name?
Hello.
Flask is running on the server via uwsgi (127.0.0.1:56733), access to it is proxied via nginx.
It opens in the browser, but at the same time, JS tries to load swagger.json at the local URL, which ultimately leads to an error:
Fetch errorFailed to fetch http://127.0.0.1:56733/swagger.json
from flask import Flask, render_template
from flask_restx import Resource, Api
# from werkzeug.middleware.proxy_fix import ProxyFix
import logging
import os
import shutil
app = Flask(__name__)
# app.wsgi_app = ProxyFix(app.wsgi_app)
api = Api(app, version='1.0', title='My API',
description='My API',
)
# -- skip --
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question