The usage of nginx Anti-proxy Server
This article mainly explains "the usage of nginx anti-proxy server". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the usage of nginx anti-proxy server.
Nginx anti-proxy configuration:
Server {
Listen 8082
Server_name localhost,10.20.1.160
# charset utf-8
# index index.php index.html index.htm
Root / app/usercenter/web
# charset koi8-r
# access_log / var/log/nginx/log/host.access.log main
Location / 132/8080/ {
Proxy_pass http://10.20.1.132:8080/;
Client_max_body_size 10m; # the maximum number of bytes per file that the client is allowed to request
Client_body_buffer_size 128k; # buffer proxy buffers maximum number of bytes requested by the client
Proxy_connect_timeout 300; # nginx connection timeout with backend server (proxy connection timeout)
Proxy_send_timeout 300; # backend server data backhaul time (proxy send timeout)
Proxy_read_timeout 300; # response time of back-end server after successful connection (proxy received timeout)
Proxy_buffer_size 4k; # sets the buffer size of the proxy server (nginx) for storing account information
Proxy_buffers 4 32k; # proxy_buffers buffer, if the average page size is less than 32k, set it like this
Proxy_busy_buffers_size 64k; # buffer size under high load (proxy_buffers*2)
Proxy_temp_file_write_size 64k; # sets the cache folder size. If it is larger than this value, it will be passed from the upstream server.
}
Location / 132/8081/ {
Proxy_pass http://10.20.1.132:8081/;
Client_max_body_size 10m; # the maximum number of bytes per file that the client is allowed to request
Client_body_buffer_size 128k; # buffer proxy buffers maximum number of bytes requested by the client
Proxy_connect_timeout 300; # nginx connection timeout with backend server (proxy connection timeout)
Proxy_send_timeout 300; # backend server data backhaul time (proxy send timeout)
Proxy_read_timeout 300; # response time of back-end server after successful connection (proxy received timeout)
Proxy_buffer_size 4k; # sets the buffer size of the proxy server (nginx) for storing account information
Proxy_buffers 4 32k; # proxy_buffers buffer, if the average page size is less than 32k, set it like this
Proxy_busy_buffers_size 64k; # buffer size under high load (proxy_buffers*2)
Proxy_temp_file_write_size 64k; # sets the cache folder size. If it is larger than this value, it will be passed from the upstream server.
}
Error_page 500 502 503 504 / 50x.html
Location = / 50x.html {
Root / usr/share/nginx/html
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
# location ~\ .php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
# location ~ /\ .ht {
# deny all
#}
}
At this point, I believe you have a deeper understanding of "the use of nginx anti-proxy server". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!