nginx后面的http代理重定向到错误的url

时间:2016-09-17 03:34:54

标签: nginx proxy jupyter

我让nginx在服务器上监听网站{{#each (GetFamilies pieces)}} {{#each (GetFamilyPieces ../pieces this)}} {{/each}} {{/each}}

我试图将www.example.com重定向到一个服务于临时iPython笔记本的http服务器,并且位于服务器端口8000 https://github.com/jupyterhub/configurable-http-proxy

www.example.com/iPython

这是日志:

server {

    listen 80;
    server_name http://xxx.xxx.xxx.xxx;
    charset utf-8;
    location /iPython {
        proxy_pass http://xxx.xxx.xxx.xxx:8000/;
    }
}

然后服务器被重定向到nginx_1 | xxx.xxx.xxx.xxx - - [19/Sep/2016:16:14:09 +0000] "GET /iPythontest HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36" "-" web_1 | Not Found: /spawn/iPythontest nginx_1 | xxx.xxx.xxx.xxx - - [19/Sep/2016:16:14:10 +0000] "GET /spawn/iPythontest HTTP/1.1" 404 9298 "http://xxx.xxx.xxx.xxx/iPythontest" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36" "-" 而不是http://www.example.com/spawn/iPython,这会在我的网站上返回404错误。我想确保以这种方式重定向所有流量,但我不确定哪个指令可以实现

0 个答案:

没有答案