Nginx reverse proxy proxy_pass rule configuration

One of the functions of Nginx is reverse proxy. Sometimes, it is necessary to forward a request to another address for other purposes.

For some reasons, the original request address may be a relatively long and specific request address, and it is inconvenient to modify, so it needs to be

Configure rules in proxy_pass to meet conditions.

Forwarding: Nginx - unique splicing rule for proxy_pass path - Jianshu

Reference: Detailed explanation of Nginx location and proxy_pass path configuration - Sooner or later, freedom will be chaotic for the rest of your life - Blog Park

Attachment 1. View the nginx installation directory

ps -ef | grep nginx

Attachment 2. View the path of the configuration file nginx.conf

 nginx -t

Attachment 3. Test whether the configuration file modification is normal
nginx -t 

Attachment 4. Reload the configuration file
nginx -s reload

 

Appendix 5. Configuration for obtaining the client’s real IP

A brief analysis of Nginx configuration to obtain the client's real IP proxy_set_header, X-Real-IP, $remote_addr,

Guess you like

Origin blog.csdn.net/u011453631/article/details/122839194