CentOS 7.8
nginx version: nginx/1.18.0
yum install nginx-module-geoip
yum install GeoIP GeoIP-data
Then, GeoIO runs well with HTTP(S).
I need nginx to forward a TCP port, which is only open to CN add to nginx.conf
stream {
geoip_country /usr/share/GeoIP/GeoIP.dat;
log_format proxy '$remote_addr [$time_local] '
'$protocol $status $bytes_sent $bytes_received '
'$session_time "$upstream_addr" '
'"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';
access_log /var/log/nginx/tcp-access.log proxy ;
open_log_file_cache off;
include tcpconf.d/*.conf;
}
xxxx.com.conf
server {
listen 11111;
proxy_pass 127.0.0.1:31688;
}
Forwarding 11111 to 31688 works OK.
add to server{