{"id":20310926,"url":"https://github.com/progrium/nginx-appliance","last_synced_at":"2025-04-11T16:05:32.387Z","repository":{"id":18001931,"uuid":"21016903","full_name":"progrium/nginx-appliance","owner":"progrium","description":"A programmable Nginx container","archived":false,"fork":false,"pushed_at":"2015-01-17T03:41:59.000Z","size":127,"stargazers_count":199,"open_issues_count":0,"forks_count":14,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-25T12:07:15.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/progrium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-19T21:52:26.000Z","updated_at":"2025-03-22T20:22:49.000Z","dependencies_parsed_at":"2022-07-13T05:30:32.557Z","dependency_job_id":null,"html_url":"https://github.com/progrium/nginx-appliance","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrium%2Fnginx-appliance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrium%2Fnginx-appliance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrium%2Fnginx-appliance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrium%2Fnginx-appliance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/progrium","download_url":"https://codeload.github.com/progrium/nginx-appliance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248438494,"owners_count":21103409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T17:35:02.942Z","updated_at":"2025-04-11T16:05:32.352Z","avatar_url":"https://github.com/progrium.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx Appliance\n\nA generic Nginx Docker container that you can configure at runtime via HTTP API. It was built using [Configurator](https://github.com/progrium/configurator), which means soon it will also integrate with various configuration stores (Consul, Etcd, ...).\n\nIt also means you can make a programmable appliance like this for any open source utility... but let's focus on Nginx for now.\n\n## Getting the container\n\nThe container is available on the Docker Index:\n\n\t$ docker pull progrium/nginx\n\n## Using the container\n\n#### Getting the welcome page\n\n\t$ docker run -d -p 8000:80 progrium/nginx\n\t$ curl localhost:8000\n\nOkay, that's maybe a little too trivial. The default Nginx config, big deal.\n\n#### Configure Nginx into a reverse proxy\n\nYou've done this before. But have you done it like this?\n\n\t$ docker run -d -p 8000:80 -p 9000:9000 progrium/nginx\n\nAdd an upstream called `app` that points to `tired.com:80`:\n\n\t$ curl -d '{\"upstream\": {\"app\": {\"server\": {\"tired.com:80\": null}}}}' localhost:9000/v1/config/http\n\nTurn the default server into a proxy to `app`:\n\n\t$ curl -d '{\"server\": [{\"listen\": 80, \"location\": {\"/\": {\"proxy_pass\": \"http://app\"}}}]}' localhost:9000/v1/config/http\n\n*Now* hit that port 8000:\n\n\t$ curl localhost:8000\n\nYou re-programmed the Nginx appliance with curl.\n\n#### Configure Nginx to serve your static files\n\nRun with a volume mount to a location like `/static`:\n\n\t$ docker run -d -p 8000:80 -p 9000:9000 -v /your/files:/static progrium/nginx\n\nReconfigure the default server to use `/static` as the root and turn on autoindex:\n\n\t$ curl -d '{\"root\": \"/static\", \"autoindex\": true}' localhost:9000/v1/config/http/server/0\n\nSee your files:\n\n\t$ curl localhost:8000/\n\n#### Working with the Nginx configuration\n\nSee the current configuration:\n\n\t$ docker run -d -p 8000:80 -p 9000:9000 progrium/nginx\n\t$ curl localhost:9000/v1/config/\n\nSee a subset or specific value of that Nginx configuration:\n\t\n\t$ curl localhost:9000/v1/config/http/server_names_hash_bucket_size\n\nChange that value:\n\n\t$ curl -d '{\"server_names_hash_bucket_size\": 128}' localhost:9000/v1/config/http\n\nSee the full REST API and experiment...\n\n#### See the actual rendered Nginx configuration being used\n\n\t$ curl localhost:/v1/render\n\n#### Hook up your Nginx appliance to a configuration store\n\nComing soon. Pull your custom config from Consul, have your HTTP changes stored there, and...\n\n#### Use configuration macros to pull more data from your config store\n\nComing soon. Make your configuration dynamic with macros that reference config store values:\n\n\t{\n\t\t...\n\t\t\"http\": {\n\t\t\t\"server_names_hash_bucket_size\": {\"$value\": \"/consul/path/to/value\"}\n\t\t\t...\n\t\t}\n\t\t...\n\t}\n\nValues are watched and cause the Nginx configuration to change in real-time.\n\n#### Iteration and conditionals with macros\n\nComing soon. The embedded macro language supports all your standard templating functionality.\n\n#### AND MORE...\n\nGet the idea?\n\n## Sponsor\n\nThis project was made possible thanks to [DigitalOcean](http://digitalocean.com).\n\n## License\n\nBSD","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogrium%2Fnginx-appliance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogrium%2Fnginx-appliance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogrium%2Fnginx-appliance/lists"}