Custom nginx install on dotcloud based on nginx, but mainly openresty
- clone this repo
- make any changes you need
- dotcloud create <app_name>
- cd into the nginx-on-dotcloud directory
- dotcloud push <app_name> .
Before you push the nginx server you need to set the following env vars:
WHITELIST_DOMAINS
a lua table of domains to whitelist
Ok, but wtfbbq is a lua table? Well, the one I test with looks like this:
dotcloud env set 'WHITELIST_DOMAINS={
["disqus.com"] = true,
["disqus.net"] = true,
["northisup.com"] = true,
}'
You set these values on your instance by as such. You may also put them in your dotcloud.yml file but that is not recommended.
!!! right now to enable oauth you will need to edit the postinstall script
Before you push the nginx server you need to set the following env vars:
ACCESS_APP_ID
Github client idACCESS_APP_SECRET
Github client secretACCESS_ORG
Github org to allow to access the app
You set these values on your instance by as such. You may also put them in your dotcloud.yml file but that is not recommended.
dotcloud env set \
'ACCESS_APP_ID=6dd82fd5a64a6f1acd9f912bcbe40004' \
'ACCESS_APP_SECRET=72fc1bf55b68d649bcd9c53a7d3a857156b24fb5' \
'ACCESS_ORG=disqus'
tl;dr nginx/builder -h
The current build script supports a few versions of nginx and uses openresty by default.
- vanilla nginx
- tengine nginx
- openresty nginx
If you need to change the way nginx is compiled, then you will need to look in the nginx/builder
file. Add any more modules or configuration options to the CONFIGOPTS
variable.
If you need to change the nginx config, then you need to edit /nginx/nginx.conf.in
. I don't really recommend doing this off the bat, the system is a little fragile.
When the custom service starts up it runs the nginx/builder
file which compiles nginx and puts everything where it needs to be.
During deployment to the host the postinstall
script will be run, and it will add the HTTP Port that it was assigned to the nginx.conf.in
file.
It will then be started up, and if all went well you should be able to start seeing pages served from nginx.
It will serve everything up under the static
directory since it treats that directory as the root directory.
To speed things up, it will only compile nginx once, if it has a good compile, it will always use that going forward. If you want to do recompile of nginx after this, you will need to edit the nginx/builder
file and uncomment step 1A at the bottom of the file.