Skip to content

Instantly share code, notes, and snippets.

@philipnrmn
Created January 12, 2017 00:36
Show Gist options
  • Save philipnrmn/00d14c4570f46219569bb601885b7555 to your computer and use it in GitHub Desktop.
Save philipnrmn/00d14c4570f46219569bb601885b7555 to your computer and use it in GitHub Desktop.
A sample nginx-on-marathon config which serves HTTP and HTTPS
{
"id": "/philip/mesos-https",
"instances": 1,
"cpus": 0.1,
"mem": 128,
"disk": 0,
"gpus": 0,
"fetch": [
{
"uri": "https://gist.githubusercontent.com/philipnrmn/1c37364baf3157f51567401c51373f5c/raw/00f435020499104b06f06fdf6caed4b435b0acf8/default.conf",
"extract": true,
"executable": false,
"cache": false
}
],
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/etc/nginx/conf.d/default.conf",
"hostPath": "default.conf",
"mode": "RO"
}
],
"docker": {
"image": "nginx",
"network": "BRIDGE",
"portMappings": [
{
"hostPort": 0,
"containerPort": 443,
"protocol": "tcp",
"servicePort": 10002
}
],
"privileged": false,
"forcePullImage": false
}
},
"healthChecks": [
{
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"protocol": "MESOS_HTTPS",
"path": "/"
}
],
"cmd": "mkdir -p /etc/nginx/ssl && openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt -subj \"/C=US/ST=California/L=SF/O=Mesosphere/OU=Frontend/CN=localhost\" && nginx -g \"daemon off;\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment