According the check-version api of ipip, we can check the ip and phone version automaticly. We’re recommanded to use crontab to autoupdate as the following:
Also you can rewrite the autoupdate.sh to suit for yourself. And the fake_ip.datx and fake_phone.txt are the fake file in order to run tests (we are recommanded to buy the service from ipip for getting the real file).
Requirements
ngx_http_ipip_module requires the following to run:
To contribute to ngx_http_ipip_module, clone this repo locally and commit your code on a separate branch.
License
This module is licenced under the BSD license.
Copyright (C) 2016 by Yang Bingwu (detailyang) detailyang@gmail.com, YouZan Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ngx_http_ipip_module
ngx_http_ipip_module is an addon for nginx to ipip
Table of Contents
How-To-Use
Set the nginx config for ngx_http_ipip_module as the following:
now you can get the ip info as the following:
or you can get the phone info as the following:
How-To-Autoupdate
According the check-version api of ipip, we can check the ip and phone version automaticly. We’re recommanded to use crontab to autoupdate as the following:
By the way, you must set the private data which is the token on ipip to the scripts/var file as the following:
Also you can rewrite the autoupdate.sh to suit for yourself. And the
fake_ip.datxandfake_phone.txtare the fake file in order to run tests (we are recommanded to buy the service from ipip for getting the real file).Requirements
ngx_http_ipip_module requires the following to run:
Directive
ipip_ip_datx
Set the ip datx file
Syntax: ipip_ip_datx /path/to/file
Default: -
Context: main
ipip_phone_txt
Set the phone txt file
Syntax: ipip_phone_txt /path/to/file
Default: -
Context: main
ipip
Enable the ngx_http_ipip_module
Syntax: ipip on|false
Default: -
Context: loc
Contributing
To contribute to ngx_http_ipip_module, clone this repo locally and commit your code on a separate branch.
License
This module is licenced under the BSD license.
Copyright (C) 2016 by Yang Bingwu (detailyang) detailyang@gmail.com, YouZan Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.