Redis restricted IP access problem

Description of the problem: During the redis access process, it was found that the information in the redis queue was taken out for no reason, and the small partner could not be found. Therefore, I want to restrict the access of redis, which is only valid for the IP of my own computer. That is: configure redis to be accessible from the external network, and only allow the specified ip to access redis

 

Solution: Find a bind attribute in the redis configuration file, which can restrict IP access. After configuration, it was found that redis failed to restart. After reviewing a lot of information, it was found that the bind is the network interface (that is, the network card. There can be multiple network cards on the server, that is, corresponding to multiple IPs. If one of the network cards is set, it means that only the address of the network card is set. Only accept external requests; if not set, all network card addresses of the server will accept external requests), not the IP of the request source.

 

Practical solution: Restrict other people's access to the redis by setting a password.

 

Remarks: The statement in the configuration file (attachment) is incorrect and misleads everyone to think that the IP address followed by bind is the IP address of the request source, but actually refers to the network card address.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326267688&siteId=291194637