Files
NomadBackup/nomad_backup/20251115_142246/nginx.json
2025-11-21 13:07:40 -08:00

10 lines
2.4 KiB
JSON

{
"Format": "hcl2",
"JobID": "nginx",
"JobModifyIndex": 13996170,
"Namespace": "default",
"Source": "job \"nginx\" {\n datacenters = [\"dc1\"]\n type = \"service\"\n group \"nginx\" {\n count = 1\n\n task \"nginx\" {\n driver = \"docker\"\n\n config {\n image = \"nginx\"\n ports = [\"http\"]\n\n volumes = [\n \"custom/default.conf:/etc/nginx/conf.d/default.conf\",\n ]\n }\n\n template {\n data = <<EOH\n server {\n listen 8080;\n server_name nginx.service.dc1.consul;\n location / {\n root /local/data;\n }\n }\n EOH\n\n destination = \"custom/default.conf\"\n }\n\n template {\n data = <<EOH\n <p>Local Services - HTTP/HTTPS</p>\n <table style=\"width:100%\">\n <tr>\n <th>Service Name</th>\n <th>Traefik</th>\n <th>Direct</th>\n </tr>\n {{range services}}\n {{range $i, $s :=service .Name}}\n {{ if eq $i 0 }}\n\n<tr>\n <td>{{.Name}}</td>\n <td><a href=\"{{ if eq .Name \"unifi\" }}https{{else}}http{{end}}://{{.Name}}.service.dc1.consul\" target=\"_blank\">{{.Name}}.service.dc1.consul</a></td>\n <td><a href=\"{{ if eq .Name \"unifi\" }}https{{else}}http{{end}}://{{.Name}}.service.dc1.consul:{{.Port}}\" target=\"_blank\">{{ if eq .Name \"unifi\" }}https{{else}}http{{end}}://{{.Name}}.service.dc1.consul:{{.Port}}</a></td>\n </tr>\n {{end}}\n {{end}}\n {{end}}\n </table>\n <p>\n Node Environment Information: <br />\n node_id: {{ env \"node.unique.id\" }} <br/>\n datacenter: {{ env \"NOMAD_DC\" }}\n </p>\n EOH\n\n destination = \"local/data/index.html\"\n change_mode = \"noop\"\n }\n\n resources {\n cpu = 100 # 100 MHz\n memory = 64 # 128 MB\n }\n service {\n name = \"nginx\"\n tags = [\"nginx\", \"web\", \"urlprefix-/nginx\", \"backend\"]\n port = \"http\"\n\n check {\n type = \"tcp\"\n interval = \"10s\"\n timeout = \"2s\"\n }\n }\n }\n\n network {\n port \"http\" {\n to = 8080\n }\n\n // port \"https\" {\n // to = 443\n // }\n }\n }\n}\n",
"VariableFlags": null,
"Variables": "",
"Version": 0
}