我目前正在运行一个flaskpython应用程序,在uWGI的帮助下运行在NGINX服务器上。静态页面总是可以访问的,但是使用连接(MySQL)的页面在2分钟后超时。发生什么事?它们变得不可用。在
我尝试过的事情:不使用全局
使用池
关闭防火墙
一。在# using python version 2.7.10
from flask import Flask, jsonify, request, session
import mysql.connector.pooling
#Make a connection with the DB
dbconfig = {
"host" : "12.34.5.78",
"database": "db",
"user": "user",
"password": "pass"
}
conn = mysql.connector.connect(pool_name = "mypool",
pool_size = 6,
**dbconfig)
#Define the root
app = Flask(__name__)
#Landings page
@app.route('/')
def index():
return "Hello World."
# return all resources by name
@app.route('/reso