【发布时间】:2017-08-19 08:29:57
【问题描述】:
我有一个运行 Nginx Gunicorn Flask SupervisorCtl 的网络服务器,但是,在我添加了一个 supervisorctl 配置之后:
[program:websitecom]
command = gunicorn app:app -b localhost:8003
directory = /home/www/flask-deploy/websitecom
user = jd
autostart=true
autorestart=true
stderr_logfile=/var/log/standard_error_websitecom
stdout_logfile=/var/log=standard_out_websitecom
和 nginx 配置:
server {
server_name website.com;
listen 80;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /static {
alias /home/www/flask-deploy/websitecom/;
}
}
app.py 的烧瓶配置:
from flask import Flask, render_template, request
app = Flask(__name__)
app.secret_key = 'asecret'
@app.route("/")
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run()
问题在于,它显示了托管在服务器上的先前配置的站点,而不是新域。
有人可以帮忙吗?
谢谢。
【问题讨论】:
标签: python nginx flask gunicorn