首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nginx proxy_pass proxy_pass不工作

nginx proxy_pass proxy_pass不工作
EN

Stack Overflow用户
提问于 2019-01-26 04:47:02
回答 1查看 3.6K关注 0票数 1

我的配置有什么问题,当我打开http://management.teampapercloud.in/时,我看到默认的nginx主页,它没有到达运行在端口3000的节点服务器。

代码语言:javascript
复制
server {
    server_name  management.teampapercloud.in www.management.teampapercloud.in;
    listen 80;

    root /usr/share/nginx/;
    # index index.html index.htm;

    location /static {
        alias /home/ubuntu/papercloud/static;
    }   

    location /media {
        alias /home/ubuntu/papercloud/paper_cloud/paper_cloud/media;
    }

    location = /favicon.ico { access_log off; log_not_found off; }

    location / {
        add_header Access-Control-Allow-Origin '*';
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Forwarded-For  $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_connect_timeout 50;
        proxy_read_timeout 50;

        # This line is important as it tells nginx to channel all requests to port 8000.
        # We will later run our wsgi application on this port using gunicorn.
        proxy_pass http://127.0.0.1:3000;

        client_max_body_size 20m;
    }

    location /.well-known/acme-challenge/ {
        try_files $uri $uri/ =404;
    }

}
EN

回答 1

Stack Overflow用户

发布于 2019-01-28 17:56:21

确保

  • 您的域指向正确的服务器IP地址。
  • 更改之后,您已经重新启动了nginx服务。
  • 查找服务器名称键入。
  • nginx.conf包含/usr/local/etc/nginx/sites启用/*;
  • nginx中的默认配置不会覆盖任何服务器块。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54375726

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档