flask+uwsgi+nginx问题

我的工程路径是这样:
microblog是根目录:
drwxr-xr-x 5 root root 4096 May 13 09:43 ./
drwxr-xr-x 5 root root 4096 May 13 09:47 ../
drwxr-xr-x 5 root root 4096 May 13 09:41 app/
-rw-r--r-- 1 root root 56 May 13 09:24 config.py
-rw-r--r-- 1 root root 199 May 13 09:26 config.pyc
drwxr-xr-x 6 root root 4096 May 11 11:10 flask/
-rw-rw-rw- 1 root root 186 May 12 13:50 microblog_uwsgi.xml
-rwxr-xr-x 1 root root 87 May 11 11:35 run.py*
drwxr-xr-x 2 root root 4096 May 11 11:11 tmp/

应用目录app:
-rwxr-xr-x 1 root root 103 May 13 09:26 init.py*
-rw-r--r-- 1 root root 299 May 13 09:26 init.pyc
drwxr-xr-x 2 root root 4096 May 11 11:19 scripts/
drwxr-xr-x 2 root root 4096 May 11 11:11 static/
drwxr-xr-x 2 root root 4096 May 12 13:40 templates/
-rwxr-xr-x 1 root root 393 May 11 14:53 views.py*
-rw-r--r-- 1 root root 713 May 11 14:53 views.pyc

我的uwsgi配置文件:

0.0.0.0:9090
app
/home/***/microblog
run.py
app
4

nginx配置:
server {
listen 0.0.0.0:80;
index index.html index.htm ;
server_name localhost;
location / {
try_files $uri $uri/ =404;
include uwsgi_params;
uwsgi_pass 127.0.0.1:9090;
if (!-e $request_filename) {
return 404;
}
root /home/***/microblog;
index index.html index.shtml index.jsp;
}
}

程序里面的路由是:
@app.route('/')
@app.route('/index')
def index():
return *****
我的服务器是在申请的免费云资源,我在外网访问http://lichehuo.cloud.icybee.cn/,
显示的是我的主页。可是我访问http://lichehuo.cloud.icybee.cn/index却报错404.
是哪里配置的不对吗?

1个回答

listen 0.0.0.0:80;改成80试试看~

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问