search

Home  >  Q&A  >  body text

nginx configures reverse proxy, and the domain name of the proxy is exposed when submitting to the forum

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....

習慣沉默習慣沉默2749 days ago660

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 17:24:54

    Try it

    proxy_redirect default
    

    Why off?

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 17:24:54

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

    reply
    0
  • Cancelreply