{"id":22751065,"url":"https://github.com/jvrplmlmn/ansible-nginx-cdn","last_synced_at":"2026-04-27T21:31:28.866Z","repository":{"id":70534026,"uuid":"80643588","full_name":"jvrplmlmn/ansible-nginx-cdn","owner":"jvrplmlmn","description":"Deploy and configure Nginx in Ubuntu LTS to support reverse proxy + SSL + Cache + Application deployment","archived":false,"fork":false,"pushed_at":"2017-02-02T17:54:01.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T06:26:28.574Z","etag":null,"topics":["ansible","ansible-playbooks","automation","configuration-management"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jvrplmlmn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-01T17:13:20.000Z","updated_at":"2024-03-17T21:41:34.000Z","dependencies_parsed_at":"2023-06-12T03:00:18.690Z","dependency_job_id":null,"html_url":"https://github.com/jvrplmlmn/ansible-nginx-cdn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jvrplmlmn/ansible-nginx-cdn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvrplmlmn%2Fansible-nginx-cdn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvrplmlmn%2Fansible-nginx-cdn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvrplmlmn%2Fansible-nginx-cdn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvrplmlmn%2Fansible-nginx-cdn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvrplmlmn","download_url":"https://codeload.github.com/jvrplmlmn/ansible-nginx-cdn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvrplmlmn%2Fansible-nginx-cdn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ansible","ansible-playbooks","automation","configuration-management"],"created_at":"2024-12-11T04:19:49.793Z","updated_at":"2026-04-27T21:31:28.848Z","avatar_url":"https://github.com/jvrplmlmn.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-nginx-cdn\n\n[![Build Status](https://travis-ci.org/jvrplmlmn/ansible-nginx-cdn.svg?branch=master)](https://travis-ci.org/jvrplmlmn/ansible-nginx-cdn)\n\n\n## Instructions\n\n### Minimum required applications\n\nIt is assumed that Ansible and at least Vagrant are installed.\n\nThis was written and tested using the following Ansible version:\n\n```\n$ ansible --version\nansible 2.2.0.0\n```\n\nVagrant version:\n\n```\n$ vagrant version\nInstalled Version: 1.9.1\nLatest Version: 1.9.1\n```\n\n### Install the role dependencies\n\n```bash\nansible-galaxy install -r requirements.yml\n```\n\n### Provision the VM\n\nIt is possible to provision a VM using Vagrant. Take into account that a private IP address has been configured, in order to allow forwarding of the privileged ports (\u003c 1024). Feel free to edit the `Vagrantfile` to use a different IP address.\n\n```\n$ vagrant up\n```\n\n### Test it\n\nVagrant will forward the ports `80`, `443` and `8080`.\n\nOn the ports `80` and `443` Nginx is listening for `HTTP` and `HTTPS` traffic.\n\n`HTTP` traffic is redirected to `HTTPS`:\n\n```\n$ curl -i http://192.168.33.10:80/api/regions\nHTTP/1.1 301 Moved Permanently\nServer: nginx\nDate: Thu, 02 Feb 2017 16:32:40 GMT\nContent-Type: text/html\nContent-Length: 178\nConnection: keep-alive\nLocation: https://192.168.33.10/api/regions\n\n\u003chtml\u003e\n\u003chead\u003e\u003ctitle\u003e301 Moved Permanently\u003c/title\u003e\u003c/head\u003e\n\u003cbody bgcolor=\"white\"\u003e\n\u003ccenter\u003e\u003ch1\u003e301 Moved Permanently\u003c/h1\u003e\u003c/center\u003e\n\u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nMaking two or more consecutive requests will show that we're getting the content from the cache. Pay attention to the `ETag`, `Last-Modified` and `X-Cache-Status` headers:\n\n**Test cached static resources:**\n\n```\n$ curl -i -X GET -L https://192.168.33.10/user/themes/cabify/img/favicon.ico --insecure -D - -o /dev/null --silent\nHTTP/1.1 200 OK\nServer: nginx\nDate: Thu, 02 Feb 2017 17:28:21 GMT\nContent-Type: image/x-icon\nContent-Length: 32988\nConnection: keep-alive\nLast-Modified: Wed, 11 May 2016 22:09:45 GMT\nETag: \"5733ada9-80dc\"\nX-Cache-Status: MISS\nAccept-Ranges: bytes\n\n$ curl -i -X GET -L https://192.168.33.10/user/themes/cabify/img/favicon.ico --insecure -D - -o /dev/null --silent\nHTTP/1.1 200 OK\nServer: nginx\nDate: Thu, 02 Feb 2017 17:28:24 GMT\nContent-Type: image/x-icon\nContent-Length: 32988\nConnection: keep-alive\nLast-Modified: Wed, 11 May 2016 22:09:45 GMT\nETag: \"5733ada9-80dc\"\nX-Cache-Status: HIT\nAccept-Ranges: bytes\n```\n\n**Test caching of responses:**\n\n```\n$ curl -i -X GET -L https://192.168.33.10/api/regions --insecure -D - -o /dev/null\nServer: nginx\nDate: Thu, 02 Feb 2017 17:30:57 GMT\nContent-Type: application/json; charset=utf-8\nContent-Length: 9155\nConnection: keep-alive\nStatus: 200 OK\nCache-Control: max-age=3600, public\nX-Country-Code: BE\nX-Powered-By: Phusion Passenger Enterprise 5.0.29\nX-Cache-Status: MISS\n\n$ curl -i -X GET -L https://192.168.33.10/api/regions --insecure -D - -o /dev/null --silent\nHTTP/1.1 200 OK\nServer: nginx\nDate: Thu, 02 Feb 2017 17:31:01 GMT\nContent-Type: application/json; charset=utf-8\nContent-Length: 9155\nConnection: keep-alive\nStatus: 200 OK\nCache-Control: max-age=3600, public\nX-Country-Code: BE\nX-Powered-By: Phusion Passenger Enterprise 5.0.29\nX-Cache-Status: HIT\n\n```\n\n\n\nOn the port `8080` we can reach the [nginx-requests-stats](https://github.com/jvrplmlmn/nginx-requests-stats) application:\n\n```\n$ curl http://192.168.33.10:8080/version --silent | jq .\n{\n  \"version\": \"0.3.0\"\n}\n$ curl http://192.168.33.10:8080/count --silent | jq .\n{\n  \"requests\": 1\n}\n```\n\n```\ncurl -i -X GET -L https://192.168.33.10/user/themes/cabify/img/favicon.ico --insecure -D - -o /dev/null --silent\n```\n\n## Using Docker (via test-kitchen)\n\nAlternatively, we can use `test-kitchen` to provision a Docker container fully provisioned by Ansible and verified by InSpec.\n\n### Install\n\nAssuming that we're using OS X and we have `brew` and `brew cask` available, we can get everything with:\n\n```bash\nbrew update\nbrew cask install docker\nbrew cask install chefdk\nbrew cask install inspec\nchef gem install kitchen-docker\nchef gem install kitchen-ansible\nchef gem install kitchen-sync\n```\n\n**Docker**\n\n```\n$ docker version\nClient:\n Version:      1.12.5\n API version:  1.24\n Go version:   go1.6.4\n Git commit:   7392c3b\n Built:        Fri Dec 16 06:14:34 2016\n OS/Arch:      darwin/amd64\n\nServer:\n Version:      1.12.5\n API version:  1.24\n Go version:   go1.6.4\n Git commit:   7392c3b\n Built:        Fri Dec 16 06:14:34 2016\n OS/Arch:      linux/amd64\n```\n\n**Kitchen (ChefDK)**\n```\n$ chef --version\nChef Development Kit Version: 1.1.16\nchef-client version: 12.17.44\ndelivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103)\nberks version: 5.2.0\nkitchen version: 1.14.2\n```\n\n**InSpec**\n```\n$ inspec version\n1.7.2\n```\n\n### Provision\n\n```bash\n$ kitchen verify\n-----\u003e Starting Kitchen (v1.14.2)\n-----\u003e Creating \u003cdefault-ubuntu-1604\u003e...\nSending build context to Docker daemon 558.1 kB57.1 kB\n(...)\n```\n\n### Test\n\nUse [this](#test-it) instructions, but replace the IP address with `localhost`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvrplmlmn%2Fansible-nginx-cdn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvrplmlmn%2Fansible-nginx-cdn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvrplmlmn%2Fansible-nginx-cdn/lists"}