The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
---
%#
%# Sample server configuration file, for a server that
%# uses nginx and hypnotoad
%#
%#
% my $l = "/home/bduggan/git";
% my $port = 8012;
% my $backend_url = '127.0.0.1:8099';
url : http://localhost:<%= $port %>
user_file     : <%= $ENV{HOME} %>/git/SimpleAuth/t/data/user.txt
group_file    : <%= $ENV{HOME} %>/git/SimpleAuth/t/data/group.txt
resource_file : <%= $ENV{HOME} %>/git/SimpleAuth/t/data/resource.txt
host_file     : <%= $ENV{HOME} %>/git/SimpleAuth/t/data/host.txt
start_mode :
    - hypnotoad
    - nginx
hypnotoad :
  listen : 'http://<%= $backend_url %>'
  proxy_pass : 1
% my $p = "$ENV{HOME}/etc/nginx/simpleauth/";
nginx :
  '-p' : <%= $p %>
  autogen :
       filename : <%= $p %>conf/nginx.conf
       content :  |
            # autogenerated file
            events {
              worker_connections  4096;
            }
            http {
                upstream myapp {
                  # use backend server on 8099
                  server <%= $backend_url %>;
                }
                server {
                  # port from url goes here
                  listen <%= $port %>;
                  server_name localhost;
                  location / {
                    proxy_read_timeout 300;
                    proxy_pass http://myapp;
                    proxy_set_header Host $http_host;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  }
                }
            }