Acting _nginx_proxy

192.168.3.222   nginx+php  略

192.168.3.22     mariadb      略   

192.168.3.21          proxy_nginx  

21host: install nginx

[root @ localhost conf.d] # CAT / etc / nginx / proxy_params
proxy_set_header Host $ HTTP_HOST; // domain name also reached the nginx
proxy_set_header the X-Real-IP-$ REMOTE_ADDR; // the client variable store and spread through IP nginx
proxy_set_header the X-Forwarded-the For-$ proxy_add_x_forwarded_for; // nginx end of the recording so that the real address of the client

proxy_connect_timeout 30; // proxy timeout links to back-end
proxy_send_timeout 60; // agent waits for the back-end response time
proxy_read_timeout 60; // return the back-end proxy timeout

proxy_buffering on; // put data buffer agent, on (default)
proxy_buffer_size 32K; // save the user agent header buffer size
proxy_buffers 4 128k; // buffer

---------------------------------------------------------------------------------------------------------

[root@localhost conf.d]# vim default.conf
server {
listen 80;
server_name www.le.com;
location / {
proxy_pass http://192.168.3.222:80;
include proxy_params;
}
}

-------------------------------------------------------------------------------------------------------

nginx -t

systemctl restart nginx

[root@localhost conf.d]# cat /etc/nginx/proxy_params proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 30;proxy_send_timeout 60;proxy_read_timeout 60;
proxy_buffering on;proxy_buffer_size 32k;proxy_buffers 4 128k;

Guess you like

Origin www.cnblogs.com/Leaders543/p/12499620.html