forked from iqiyi/dpvs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
This patch is for Nginx to get real client ip when you are using | ||
NAT64 mode(VIP is IPv6 while RS is IPv4). | ||
You can use this patch only when toa module is installed. | ||
|
||
Here is an exampe to configure http block in nginx.conf: | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$toa_remote_addr $toa_remote_port $remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /data/nginx/logs/access.log main; | ||
|
||
keepalive_timeout 65; | ||
|
||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
access_log /data/nginx/logs/access.log main; | ||
|
||
location / { | ||
proxy_set_header X-Forwarded-For $toa_remote_addr; | ||
proxy_pass http://192.168.1.1; | ||
} | ||
} | ||
|
||
} |