How to prevent the website from being accessed by malicious reverse proxy (anti-website image ). What is reverse proxy? Let's talk about the concept of forward proxy first: Forward proxy, which is also the legendary proxy. his working principle is like a stepping stone. To put it simply, I am a user and I
What is reverse proxy?
First, let's talk about the concept of forward proxy:
A forward proxy, the legendary proxy, works like a stepping stone. Simply put, I am a user and cannot access a website, but I can access a proxy server. This proxy server, he can access the website that I cannot access, so I first connected to the proxy server and told him that I needed the content that could not access the website and the proxy server went back, then return it to me. From the perspective of a website, a record is recorded only when the proxy server obtains the content. sometimes it does not know that it is a user's request or the user's information is hidden. this depends on the proxy not telling the website.
The conclusion is that the forward proxy is a server located between the client and the origin server. to get content from the origin server, the client sends a request to the proxy and specifies the target (the original server). then, the proxy transfers the request to the original server and returns the obtained content to the client. The client must make some special settings to use the forward proxy.
What is the concept of reverse proxy?
For example, the user visits the http://www.nowamagic.net/librarys/veda page, but www.nowamagic.net does not actually exist in this page, he is secretly from another server back, and then as their own content to the user.
However, users do not know, which is normal and generally stupid. The server corresponding to the domain name www.nowamagic.net mentioned here sets the reverse proxy function.
The conclusion is that reverse proxy is the opposite. for a client, it is like an original server, and the client does not need to perform any special settings. The client sends a common request to the content in the namespace (name-space) of the reverse proxy, and then the reverse proxy determines where (original server) to transfer the request, and return the obtained content to the client, just as the content is originally its own.
Dangers of malicious reverse proxy
What are the dangers of website malicious reverse proxy? Here is a list:
• The server resources will be occupied first, and the website opening speed will be affected.
• If someone else steals your website data through proxy, it is equivalent to building a site identical to yours for users and less intelligent search engines, it is very likely that your site will enter the search engine sandbox, or even be downgraded.
• If your webpage is maliciously represented and your Federated advertisement (such as Adsense) is mounted, it is very dangerous. if someone clicks the advertisement above, it is easily blocked by Adsense.
• There are still many dangers, so readers can make up their own brains ......
Js-level solutions
The code is as follows: