{"id":26623798,"url":"https://github.com/okelet/front-back-gateway","last_synced_at":"2026-04-14T04:31:25.111Z","repository":{"id":188684610,"uuid":"386687888","full_name":"okelet/front-back-gateway","owner":"okelet","description":"Easyly configurable nginx proxy with backend and frontend endpoints","archived":false,"fork":false,"pushed_at":"2021-08-20T14:04:19.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T11:58:32.085Z","etag":null,"topics":["backend","docker","docker-compose","frontend","nginx","proxy"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okelet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-07-16T15:44:40.000Z","updated_at":"2021-08-20T14:04:22.000Z","dependencies_parsed_at":"2023-08-16T13:03:54.981Z","dependency_job_id":"273e7700-4ccc-4f9e-8c7d-7fb8ac4ac6f5","html_url":"https://github.com/okelet/front-back-gateway","commit_stats":null,"previous_names":["okelet/front-back-gateway"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/okelet/front-back-gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Ffront-back-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Ffront-back-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Ffront-back-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Ffront-back-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okelet","download_url":"https://codeload.github.com/okelet/front-back-gateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okelet%2Ffront-back-gateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31782736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["backend","docker","docker-compose","frontend","nginx","proxy"],"created_at":"2025-03-24T10:18:23.852Z","updated_at":"2026-04-14T04:31:25.095Z","avatar_url":"https://github.com/okelet.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frontend/Backend gateway\n\n[![Github repository](https://img.shields.io/badge/okelet-front--back--gateway-brightgreen)](https://github.com/okelet/front-back-gateway)\n[![DockerHub pulls](https://img.shields.io/docker/pulls/okelet/front-back-gateway.svg)](https://hub.docker.com/repository/docker/okelet/front-back-gateway)\n\nThis Docker image is based on the [nginx](https://hub.docker.com/_/nginx) image, and configures automatically a gateway, that forwards requests to two backends, simulating the frontend/backend pattern. This image was created to simulate the behaviour of the [Spring Cloud Gateway](https://spring.io/projects/spring-cloud-gateway) image, for doing the initial infrastructure deployment, before the real software is deployed. I usually use the [mendhak/http-https-echo](https://hub.docker.com/r/mendhak/http-https-echo) or [containous/whoami](https://hub.docker.com/r/containous/whoami) images as the backend.\n\nYou can test it using this command:\n\n```bash\ndocker run --rm -it \\\n    -p 8080:8080 -p 8443:8443 \\\n    -e FRONTEND_URL=https://httpbin.org/anything/frontend \\\n    -e BACKEND_URL=https://httpbin.org/anything/backend \\\n    okelet/front-back-gateway:1.0\n```\n\nNginx will forward the requests according to this configuration:\n\n* `/api/*` -\u003e backend\n* `/*` -\u003e frontend\n\nFor example:\n\n* \u003chttp://127.0.0.1:8080/api/hello\u003e -\u003e would return a JSON document, where the \"url\" field is \u003chttps://httpbin.org/anything/backend/api/hello\u003e\n* \u003chttp://127.0.0.1:8080/index.html\u003e -\u003e would return a JSON document, where the \"url\" field is \u003chttps://httpbin.org/anything/frontend/index.html\u003e\n\nYou don't have to worry about invalid SSL certificates in the backends, as nginx, by default, doesn't check its validity when proxying the requests.\n\nnginx is [configured to listen in the ports HTTP/8080 and HTTPS/8443](templates/nginx.conf.template) using a self signed certificate, valid for 10 years.\n\n## Environment variables\n\n* `BACKEND_URL` (mandatory): URL where requests under `/api` will be forwarded.\n* `FRONTEND_URL` (mandatory): URL where requests not matching the previous route will be forwarded.\n* `DNS_RESOLVER` (optional): nginx requires a DNS server to resolve the forwarded servers; if this value is not set, it will be guessed automatically from `/etc/resolv.conf`.\n\n## Test using docker-compose\n\nA [`docker-compose.yml`](docker-compose.yml) is included in the repo, so the image is easy to run and test.\n\n```bash\ndocker-compose up -d                       # Start the containers\nsleep 5                                    # Wait for containers to start\ncurl http://127.0.0.1:8080/index.html      # Returns Name: frontend, GET /index.html HTTP/1.1\ncurl http://127.0.0.1:8080/api/test        # Returns Name: backend, GET /api/test HTTP/1.1\ndocker-compose rm -sf                      # Stop and remove the containers\n```\n\n## Repositories\n\nThis image is available in the following repositories:\n\n* [Docker Hub](https://hub.docker.com/repository/docker/okelet/front-back-gateway)\n* [AWS Public ECR](https://gallery.ecr.aws/okelet/front-back-gateway)\n* [GitHub Packages](https://github.com/okelet/front-back-gateway/pkgs/container/front-back-gateway)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokelet%2Ffront-back-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokelet%2Ffront-back-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokelet%2Ffront-back-gateway/lists"}