Problem with nginx reverse proxy binding independent domain name?
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 17:26:37
0
2
786

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梦

reply all(2)
仅有的幸福
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.

小葫芦

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

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