What is token?
Security tokens
function:
Prevent robot Brush Requests
Effect:
No token connection is added to the IDC environment, directly to the 404 page
Token's flow in the HTTP protocol of Ngnix:
nginx module and configuration:Reverse proxy:
Location/{
Proxy_pass http://localhost:8000;
Proxy_set_header X-real-ip $remote _addr;
}
Load Balancing:
upstream.com {
Server 192.168.5.126:80;
Server 192.168.5.27:80;
}
server{
Listen;
server_name a.com;
Location /{
Proxy_pass http://a.com;
proxy_set_header Host $host;
proxy_set_header x-real-ip $remote _addr;
proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
}
}
Page buffering:
/usr/local/nginx/conf/proxy.conf
Proxy_redirect off;
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_set_header accept-encoding ' gzip ';
Client_max_body_size 100m;
Client_body_buffer_size 256k;
Proxy_connect_timeout 60;
Proxy_send_timeout 60;
Proxy_read_timeout 60;
Proxy_buffer_size 512k;
Proxy_buffers 8 512k;
Proxy_busy_buffers_size 512k;
Proxy_temp_file_write_size 512k;
This configures dynamic files that cannot be cached, and HTML files can be cached
URL rewriting:
When accessing http://abc.test.com jump to http://www.test.com/test/abc/
rewrite command
server {
Listen 80;
server_name*.test.com;
if ($http _host ~* "^ (. *) \.test\.com$") {
Set $domain $;
Rewrite ^ (. *) http://www.test.com/test/$domain/break;
}
}
Nginx-token Verification