CGI IP echo service.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
cgip
default.nix

README.md

cgip

CGI IP echo service.

Deployment

Example deployment on a NixOS system (import the following web server configuration in your configuration.nix):

{ config, pkgs, ... }:

let cgip = pkgs.callPackage /path/to/cgip {};
in {
  services.nginx.enable = true;

  services.nginx.httpConfig = ''
    server {
      listen       80;
      server_name  _;

      location / {
        fastcgi_pass   unix:${config.services.fcgiwrap.socketAddress};
        fastcgi_param  SCRIPT_FILENAME ${cgip}/bin/cgip;
        include        ${pkgs.nginx}/conf/fastcgi_params;
      }
    }
  '';

  services.fcgiwrap.enable = true;

  networking.firewall.allowedTCPPorts = [ 80 ];
}