What is reverse proxy?
A reverse proxy is a proxy server that accepts connection requests from the Internet and forwards the requests to an internal (or other) network server, return the result obtained from the server to the Client Requesting connection from the Internet.
Implementation Method:
For example, I want to create a t.vpser.net domain name on Linuxwendang/index.html '> VPS for reverse proxy access to twitter, first, add A record to the IP address of t.wendang/index.html> VPS for the domain name t.vpser.net on the domain name management at the domain name registrar, and then modify the Nginx configuration file on VPS. Add the following:
Server {listen 80; server_name t.vpser.net; location/{proxy_pass http://twitter.com/; proxy_redirect off; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ response ;}}
After the configuration is added, run:/usr/local/nginx/sbin/nginx-t to check whether the configuration is normal. If: the configuration file/usr/local/nginx/conf/nginx. conf syntax is OK configuration file/usr/local/nginx/conf/nginx. conf test is successful. Otherwise, modify the configuration according to the error message.
Run kill-HUP 'cat/usr/local/nginx/logs/nginx. pid 'to make the configuration take effect. After the domain name resolution takes effect, you can access twitter through t.vpser.net.