Skip to content

Server install under NGINX

Arnaud Richard edited this page Dec 14, 2016 · 5 revisions

This does not work anymore (#195). Until it is fixed, you have to mount oauthd on a root path.


Requirements

  • Publicly available SSL HTTP server (e.g. through NGINX), with domain ssl.example.com
  • Use HTTP server to Proxy from /oauth HTTP context root to allow use of other web apps under SSL
  • Ensure nothing from oauthd is available from the outside (i.e. oauthd is accessible only from loopback)
  • Simplest configuration possible

Configuration files

config.local.js

Note: I do not use ssl settings, i use the WebServer's

    {
    // ...
        host_url:   'https://ssl.example.com',
        base:        "/oauth",
        base_api: "/oauth/api",
        port:         6284,
        bind:         '127.0.0.1'
    // ...
    }

Under NGINX

server {
    listen       443 ssl;
    server_name  ssl.example.com;

    ssl                  on;
    ssl_certificate      /etc/ssl/mycert.pem;
    ssl_certificate_key  /etc/ssl/mycert.key;

    location /oauth {
      proxy_pass  http://127.0.0.1:6284;  // nothing else is required :)
    }
}