Nginx configuration reverse proxy

  
 Server { listen 80; server_name www.baidu.com; location /{ proxy_pass http://1.2.3.4; //backend ip address proxy_redirect off; //close the header returned by the backend modify proxy_set_header Host $host; //modify Host proxy_set_header sent to the backend X-Real-IP $remote_addr; //Set the real ip proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }

nginx configuration reverse proxy is very simple, only need to be configured in nginx.conf The file is added to the server block.

Copyright © Windows knowledge All Rights Reserved