Skip to content

Instantly share code, notes, and snippets.

@rudigiesler
Last active November 18, 2015 04:38
Show Gist options
  • Save rudigiesler/3eabcf1af58dc3f78c8f to your computer and use it in GitHub Desktop.
Save rudigiesler/3eabcf1af58dc3f78c8f to your computer and use it in GitHub Desktop.
A simple supervisord and Nginx config for running a real API.
max_contacts_per_page: 5
max_groups_per_page: 5
riak_manager: {bucket_prefix: test}
server {
listen 9000;
server_name localhost;
location /api/ {
auth_request /auth/;
auth_request_set $owner_id $upstream_http_x_owner_id;
auth_request_set $scopes $upstream_http_x_scopes;
proxy_pass http://localhost:8888/;
proxy_set_header X-Owner-ID $owner_id;
proxy_set_header X-Scopes $scopes;
}
location /auth/ {
internal;
proxy_pass http://localhost:8889/;
proxy_set_header Content-Length "";
proxy_pass_request_body off;
}
}
[supervisord]
nodaemon=1
[supervisorctl]
serverurl=http://localhost:9001
[inet_http_server]
port=localhost:9001
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[program:auth]
env=
PYTHONPATH=/home/rudi/pk/go-auth/
command=/home/rudi/pk/go-auth/ve/bin/twistd -n --pidfile=auth.pid cyclone -p 8889 --app go_auth.bouncer.Bouncer --appopts=/home/rudi/pk/go-auth/config.yaml
[program:api]
env=
PYTHONPATH=/home/rudi/pk/go-contacts-api/
command=/home/rudi/pk/go-contacts-api/ve/bin/twistd -n --pidfile=api.pid cyclone -p 8888 --app go_contacts.server.ContactsApi --appopts=/home/rudi/pk/go-contacts-api/config.yaml
auth_store:
auth-token:
client_id: 1
owner_id: 1
scopes: [scope1, scope2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment