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?
仅有的幸福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.