nginx根据客户端ip进行简单转发(回发)
来源:互联网 发布:南风知我意小说 编辑:程序博客网 时间:2024/05/20 18:01
配置文件下载路径:下载
配置文件default.vhosts.conf:
log_format ie '$remote_addr [$time_local:$msec] "POST $request_uri&$request_body HTTP/1.0" "$http_referer" "$http_user_agent"';log_format customed_ie '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';server{include vhosts/vhosts.listen.addr; if ($remote_addr ~* "10.11.202.181") { rewrite ^/(.*) http://$remote_addr:8080/$1; #根据ip匹配,回发给自己 } location ~ ^/post {proxy_pass http://localhost:9999;access_log logs/ie_access_log ie; #记录日志}location = /q {proxy_pass http://localhost:9999;access_log logs/ie_access_log ie; #记录日志}location ~ .*\.php${include fastcgi.conf;fastcgi_pass localhost:9000;fastcgi_index index.php;access_log logs/getrank_access_log ie; #记录日志}location /{access_log logs/ie_access_log customed_ie; #记录日志}}
配置文件nginx.conf:user nobody nobody;worker_processes 8;working_directory /search/nginx/core;worker_rlimit_core 2G;#error_log logs/error.log error;error_log logs/error.log debug;pidsbin/nginx.pid;worker_rlimit_nofile 51200;events {use epoll;worker_connections 51200;}http {include mime.types;default_type application/octet-stream;set_real_ip_from 10.15.4.0/24; set_real_ip_from 10.12.0.0/16; set_real_ip_from 10.11.0.0/16; set_real_ip_from 10.10.0.0/16; set_real_ip_from 10.14.0.0/16; set_real_ip_from 10.13.0.0/16; real_ip_header X-Real-IP;include xnet.conf;log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent $request_time "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';log_format mini '$time_local $status $body_bytes_sent $request_time $upstream_cache_status $server_name'; access_log logs/access_log main; access_log logs/status_log mini;server_names_hash_bucket_size 128;client_header_buffer_size 32k;large_client_header_buffers 4 32k;client_max_body_size 20m;sendfileon;tcp_nopushon; tcp_nodelay on;#keepalive_timeout 30;send_timeout 300;proxy_next_upstream error timeout; proxy_connect_timeout 2; proxy_read_timeout 5;#fastcgi_connect_timeout 300;#fastcgi_send_timeout 300;#fastcgi_read_timeout 300;#fastcgi_buffer_size 64k;#fastcgi_buffers 4 64k;#fastcgi_busy_buffers_size 128k;#fastcgi_temp_file_write_size 128k;#gzip on;proxy_cache_path /dev/shm/nginx/cache2/ levels=2:2 keys_zone=sogou-cache2:154m max_size=1g inactive=24h ; proxy_cache_path /dev/shm/nginx/cache/ levels=2:2 keys_zone=sogou-cache:308m max_size=3g inactive=72h ; proxy_temp_path /dev/shm/nginx/temp/; fastcgi_cache_path /search/nginx/fastcgi_cache/ levels=2:2 keys_zone=sogou-fccache:128m max_size=4g inactive=72h ; fastcgi_temp_path /search/nginx/fastcgi_temp/;include vhosts/*.conf; }
- nginx根据客户端ip进行简单转发(回发)
- nginx根据域名转发不同ip端口
- nginx转发获取真实客户端IP地址
- nginx根据$remote_addr分发 nginx根据客户端IP分发
- nginx根据$remote_addr分发 (客户端IP)
- nginx 根据IP 进行灰度发布
- nginx 根据IP 进行灰度发布
- 服务器控件在客户端触发alert对话框后,根据情况进行回发服务器操作
- Node.js 获取客户端IP, 以及nginx转发携带客户端ip配置
- nginx根据客户端ip动态代理后端服务-TCP
- 根据IP(有代理的情况)定位城市以及通过nginx转发的tomcat如何得到用户真实的ip
- 根据Request获取客户端IP
- 根据Request获取客户端IP
- 根据Request获取客户端IP
- 根据Request获取客户端IP
- 根据Request获取客户端IP
- 根据Request获取客户端IP
- 根据Request获取客户端IP
- ASP.NET MVC 請問如何取得上一個網址
- MediaPlayer的基本使用
- 图书封面的故事之“阿尔特温人”——选自《Erlang/OTP并发编程实战》图书封面
- nexus工作目录设置
- 深入浅出设计模式笔记之六:桥梁模式
- nginx根据客户端ip进行简单转发(回发)
- undone
- Sobel梯度算子
- 辞职后,五险一金的处理
- IE6躲猫猫bug【幽灵文本】
- 导入anndroid项目时,@Override报错
- 搭建QT+VS2008集成开发环境
- vswprintf return -1的问题
- HDU 1027 Ignatius and the Princess II