nginx没有在其他位置部署

时间:2017-08-09 06:35:50

标签: nginx flask gunicorn

这是我的.conf文件,用于我的nginx服务器部署带有gunicorn的烧瓶应用程序,它在mysite.xyz上完美运行我希望应用程序部署在mysite.xyz/app但是,我必须遗漏一些因为我不能想办法。我尝试将location / {更改为location /app {无效。

server {
    listen 80;
    server_name mysite.xyz;

    location / {
        include proxy_params;
        proxy_pass http://unix:/var/www/app/app.sock;
    }
}

1 个答案:

答案 0 :(得分:0)

尝试编辑位置,类似的东西;也为什么你不使用fastcgi_pass

server {
    listen 80;
    server_name mysite.xyz;

location / {

            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ /index.html;
    }

location /app {
        include proxy_params;
        proxy_pass http://unix:/var/www/app/app.sock:/app;
    }
}
相关问题