Giter Club home page Giter Club logo

ngx_http_ipdb_module's Introduction

Name

travis-ci Coverage Status

ngx_http_ipdb_module - creates variables with values depending on the client IP address or specifies address, using the precompiled ipip.net ipdb.

Table of Contents

Status

The module is currently in active development.

Back to TOC

Install

configure --prefix=/usr/local/nginx --add-module=./github.com/vislee/ngx_http_ipdb_module
# or
configure --prefix=/usr/local/nginx --add-dynamic-module=./github.com/vislee/ngx_http_ipdb_module --with-compat

Back to TOC

Example Configuration

# load_module ./modules/ngx_http_ipdb_module.so;

http {
    include       mime.types;
    default_type  application/octet-stream;

    ......

    ipdb /tmp/nginx/conf/ipiptest.ipdb;
    ipdb_language CN;
    ipdb_proxy 127.0.0.1;
    ipdb_proxy_recursive on;

    server {
        listen       8090;
        server_name  localhost;

        ......

        location / {
            # ipdb_specifies_addr $http_addr;
            # ipdb_language EN;
            return 200 $ipdb_city_name;
        }
    }
}

Back to TOC

TODO

  • add variable
    • ipdb_country_code
    • ipdb_continent_code
    • ipdb_org
    • ipdb_idc
    • ipdb_latitude
    • ipdb_longitude

Back to TOC

Directives

ipdb

syntax: ipdb file;

default: -

context: http

Specifies a database.

ipdb_language

syntax: ipdb_language EN|CN;

default: EN

context: http,server,location

set variable language.

ipdb_proxy

syntax: ipdb_proxy address|CIDR;

default: -

context: http

Defines trusted addresses.

ipdb_proxy_recursive

syntax: ipdb_proxy_recursive on|off;

default: off

context: http

Is recursive search.

ipdb_specifies_addr

syntax: ipdb_specifies_addr address;

default: -

context: http,server,location

Specifies the address. The address can contain text, variables.

Back to TOC

Variable

ipdb_country_name

$ipdb_country_name - country name, for example, "**", "China"

ipdb_region_name

$ipdb_region_name - country region name, for example, "内蒙古","Nei Mongol", "北京", "Beijing"

ipdb_city_name

$ipdb_city_name - city name, for example, "呼和浩特", "Hohhot", "北京", "Beijing"

ipdb_isp_domain

$ipdb_isp_domain - ISP name, for example, "电信", "ChinaTelecom"

Back to TOC

Author

wenqiang li(vislee)

Back to TOC

Copyright and License

This module is licensed under the GPL license.

Copyright (C) 2018-2019, by vislee.

All rights reserved.

Back to TOC

See Also

ngx_http_ipdb_module's People

Contributors

vislee avatar

Watchers

DAVid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.