0

I run a flask project in my server CentOS 8.2.

This is the flask running listen address: 127.0.0.1:5000

(venv) [root@a0fa831054a7 app]# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:5000          0.0.0.0:*               LISTEN     

in the file /opt/nginx-ui/app/ui/views.py:

from app.ui import ui
import flask
import os


@ui.route('/',  methods=['GET'])
def index():
    """
    Delivers the home page of Nginx UI.

    :return: Rendered HTML document.
    :rtype: str
    """
    nginx_path = flask.current_app.config['NGINX_PATH']
    config = [f for f in os.listdir(nginx_path) if os.path.isfile(os.path.join(nginx_path, f))]
    return flask.render_template('index.html', config=config)

now I want to change the address:port to a public IP address, but I don't know where is the configure file. I searched the project directory, don't find a config file with the address 127.0.0.1 and port 5000.


EDIT-01

The processes of running flask project:

cd nginx-ui

virtualenv venv

source venv/bin/activate

pip3 install -r requirements.txt

flask run
user7693832
  • 6,119
  • 19
  • 63
  • 114

0 Answers0