Home  >  Q&A  >  body text

Problem with nginx reverse proxy binding independent domain name?

Scenes:

Multi-user system binds independent domain names to users

Main domain name: www.xxx.com/username

Independent domain name: www.username.com (any)

question:

Since the multi-user system server is in China, it cannot directly resolve the user’s independent domain name

So there is a foreign host as a reverse proxy server (nginx)

proxy.xxx.com As an independent domain name CNAME points to

How to configure this reverse proxy server?

Thanks

It is similar to LOFTER blog. How is this achieved?

过去多啦不再A梦过去多啦不再A梦2734 days ago761

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 17:28:37

    server {
        listen 80 default_server;
    
        location / {
            proxy_set_header Host $host;
            proxy_redirect off;
            proxy_pass http://<国内服务器>/;
        }
    }
    

    Then the domestic server first verifies that the source IP of the request is the specified IP (preventing the user from directly resolving the domain name to the domestic server), and then displays the user's site based on the Host in the request.

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 17:28:37

    It is similar to the LOFTER blog. How is this achieved?

    reply
    0
  • Cancelreply