nginx configures reverse proxy, and the domain name of the proxy is exposed when submitting to the forum
習慣沉默
習慣沉默 2017-05-16 17:22:54
0
2
661

This is my first time using nginx. I configured a reverse proxy with nginx. The configuration is as follows:

server
{
    listen 80;
    server_name localhost;
    location ~/bbs/ {
        proxy_redirect off;
        proxy_set_header Host bbs.example.com:8771;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://bbs.example.com:8771;
    }
}

I want to realize that when I visit www.example.com/bbs/, I can proxy to http://bbs.example.com:8771, so that the configuration can also be accessed normally. But there is a problem. The forum is jforum. Once I post in the forum, the domain name will still jump back to the actual address http://bbs.example.com:8771. The guess is "proxy_set_header Host bbs.example.com:8771" ;" Problem with this place. Please also answer your questions....

習慣沉默
習慣沉默

reply all(2)
仅有的幸福

Try it

proxy_redirect default

Why off?

淡淡烟草味

It is recommended to read this article, the content has been replaced.
http://drops.wooyun.org/tips/6403

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