Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Update README, add example nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Lushpai committed Jul 18, 2013
1 parent 3a9e09b commit d034146
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Expand Up @@ -2,3 +2,30 @@ bzgen
=======

Simple generator of zone files for Bind.

## Setup

* Put all files to any place you like
* Setup nginx to work with app (see nginx.conf)
* Make sure that you have Mjolicious installed
* Add generate.pl to crontab

## Usage

To control your api instances run:

`sh /path/to/servrun.sh -c <start|stop|restart> [-e <development|production|test>]`

By default environment parameter is `development`.
To change it on start or restart pass `-e` parameter as showed in example above.

## How it works

* API script recieve requests such as domain name or cname record and put data in database.
* Cron script read data from db, add records to main bind configuration file and generate dns zone files.

## TODO

* Add methods for all record types
* Make `under` sub for api key check

15 changes: 15 additions & 0 deletions config/nginx.conf
@@ -0,0 +1,15 @@
upstream api {
server 127.0.0.1:8088;
}

server {
listen 127.0.0.1:80;
server_name api.bzgen.dev;
root /var/www/bzgen;
location / {
proxy_read_timeout 300;
proxy_pass http://api;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

0 comments on commit d034146

Please sign in to comment.