nginx configuration as reverse proxy failed
天蓬老师
天蓬老师 2017-05-16 17:10:42
0
3
951

Add the following code to nginx.conf:

# node test
server {
    listen 80;
    server_name www.baidu.com;
    location /{
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
    }
}

In http{}, the location should be ok, localhost:8000 can be started, then start nginx, open www.baidu.com or Baidu page, please guide

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
黄舟

My guess is that hostthere is no corresponding binding added

習慣沉默

Reverse proxy is a proxy set on the server side. When you visit Baidu, of course it is still a Baidu page.

PHPzhong

Bind hosts, /etc/hosts

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template