2025-10-12 20:59:52 +03:00
2025-10-12 19:00:07 +03:00
2025-10-12 19:00:07 +03:00
2020-02-02 15:55:44 -05:00
2020-02-02 15:55:44 -05:00
2020-02-02 15:55:44 -05:00
2025-10-12 19:00:07 +03:00
2019-05-30 20:35:20 +01:00
2025-10-12 19:00:07 +03:00

IPINFO Docker mod for Nginx based images

This mod downloads the ipinfo_lite.mmdb database under /config/geoip2db, the database is updated daily.

This mod should not be enabled together with swag-maxmind or swag-dbip mods.

Follow these steps to enable the ipinfo mod:

  1. Sign up and aquire an ipinfo token here: https://ipinfo.io/signup

  2. In the container's docker arguments, set the following environment variables:

    • IPINFO_TOKEN=<token> with your token.
  3. In the container's docker arguments, set an environment variable DOCKER_MODS=linuxserver/mods:swag-ipinfo

    If adding multiple mods, enter them in an array separated by |, such as DOCKER_MODS=linuxserver/mods:swag-ipinfo|linuxserver/mods:swag-mod2

  4. Recreate the container to apply the changes.

  5. Add the following line to /config/nginx/nginx.conf under the http section:

    include /config/nginx/ipinfo.conf;
    
  6. Edit /config/nginx/ipinfo.conf and add countries to the blocklist / whitelist according to the comments, for example:

    map $geoip2_data_country_iso_code $geo-whitelist {
        default no;
        UK yes;
    }
    
    map $geoip2_data_country_iso_code $geo-blacklist {
        default yes;
        US no;
    }
    
  7. Use the definitions in the following way:

     server {
         listen 443 ssl;
         listen [::]:443 ssl;
    
         server_name some-app.*;
         include /config/nginx/ssl.conf;
         client_max_body_size 0;
    
         if ($lan-ip = yes) { set $geo-whitelist yes; }
         if ($geo-whitelist = no) { return 404; }
    
         location / {
    

    Or for blacklist with both some countries and continents:

    server {
        listen 443 ssl;
        listen [::]:443 ssl;
    
        server_name some-app.*;
        include /config/nginx/ssl.conf;
        client_max_body_size 0;
    
        if ($lan-ip = yes) { set $geo-blacklist yes; }
        if ($geo-blacklist = no) { return 404; }
        if ($continent-blacklist = no) { return 404; }
    
        location / {
    
  8. Restart the container to apply the changes.

Description
No description provided
Readme GPL-3.0 6.5 MiB
Languages
Text 100%