Skip to content

Instantly share code, notes, and snippets.

View vastbinderj's full-sized avatar

James Vastbinder vastbinderj

View GitHub Profile
@vastbinderj
vastbinderj / README.md
Created November 27, 2014 08:22
Configure NGINX to proxy Ottemo Foundation API Server for both HTTP/HTTPS

It is suggested that you only run Foundation API Server over SSL and use nginx as a proxy for performance reasons. This gist demonstrates how to configure nginx and create a certificate for use in development. In production, it is suggested you use a certificate from your preferred certificate authority.

Create a directory called 'ssl' under the nginx configuration directory to hold the certificates:

sudo mkdir /etc/nginx/ssl

Now that we have a location to place our files, we can create the SSL key and certificate files in one motion by typing:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
@vastbinderj
vastbinderj / gist:6dfc2e36ec82aa01d986
Created May 24, 2014 03:11
negroni with httprouter
package main
import (
"fmt"
"net/http"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
)
@vastbinderj
vastbinderj / ottemo.go
Created April 9, 2014 15:14
ottemo-create-user-func
package main
import (
"fmt"
"github.com/codegangsta/martini"
"github.com/martini-contrib/binding"
"github.com/martini-contrib/render"
"github.com/martini-contrib/secure"
"github.com/martini-contrib/sessions"
"github.com/ottemo/ottemo-go/auth"