{"id":21008011,"url":"https://github.com/caged/nginx-test","last_synced_at":"2026-06-22T12:31:12.398Z","repository":{"id":66029582,"uuid":"232961279","full_name":"caged/nginx-test","owner":"caged","description":"example on how to serve nextjs subdirectories using a subdomain and nginx reverse proxy","archived":false,"fork":false,"pushed_at":"2020-01-10T06:41:12.000Z","size":103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T15:19:14.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/caged.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-10T03:53:30.000Z","updated_at":"2020-01-10T06:41:14.000Z","dependencies_parsed_at":"2023-03-10T23:29:58.082Z","dependency_job_id":null,"html_url":"https://github.com/caged/nginx-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/caged/nginx-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caged%2Fnginx-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caged%2Fnginx-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caged%2Fnginx-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caged%2Fnginx-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caged","download_url":"https://codeload.github.com/caged/nginx-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caged%2Fnginx-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34649816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-19T09:11:11.435Z","updated_at":"2026-06-22T12:31:12.381Z","avatar_url":"https://github.com/caged.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Running\n\nEdit your `/etc/hosts` file and add\n\n```\n127.0.0.1\tnginx-test.local\n127.0.0.1\tadmin.nginx-test.local\n```\n\n```\ndocker-compose up\n```\n\n### About\n\nHow to use an nginx reverse proxy to serve a subdirectory in nextjs through a subdomain. For example, if you have a pages directory that is structured\n\n```\npages/\n  - index.js\n  - about.js\n  - admin/\n      - index.js\n      - dashboard.js\n```\n\nTypically, you would access the admin pages as `http://host/admin` and `http://host/admin/dashboard`, however if you use nginx reverse proxy, you can use a subdomain to mask the `admin` folder.\n\n- http://admin.host - serves pages/admin\n- http://admin.host/dashboard - serves pages/admin/dashboard\n\nIt's important to note that you must set the `assetPrefix` in `next.config.js` to the host root when doing this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaged%2Fnginx-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaged%2Fnginx-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaged%2Fnginx-test/lists"}