{"id":15488246,"url":"https://github.com/byjg/docker-static-httpserver","last_synced_at":"2026-04-01T20:02:42.325Z","repository":{"id":71043575,"uuid":"280079446","full_name":"byjg/docker-static-httpserver","owner":"byjg","description":"Really minimal HTTP Server for static files written in GO","archived":false,"fork":false,"pushed_at":"2024-06-05T02:30:44.000Z","size":3093,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T05:49:31.353Z","etag":null,"topics":["go","golang","http-server","httpserver","static","static-site"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/byjg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"byjg"}},"created_at":"2020-07-16T07:02:21.000Z","updated_at":"2024-11-08T16:05:06.000Z","dependencies_parsed_at":"2024-06-21T18:59:17.711Z","dependency_job_id":"50ed74f2-ebbd-43f5-9db1-f537212c0b80","html_url":"https://github.com/byjg/docker-static-httpserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/byjg/docker-static-httpserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fdocker-static-httpserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fdocker-static-httpserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fdocker-static-httpserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fdocker-static-httpserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byjg","download_url":"https://codeload.github.com/byjg/docker-static-httpserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fdocker-static-httpserver/sbom","scorecard":{"id":260001,"data":{"date":"2025-08-11","repo":{"name":"github.com/byjg/docker-static-httpserver","commit":"2662139ca7e0d9b9a4b887e5090d7b2c5331bb95"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/build.yml:22","Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:116: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/byjg/docker-static-httpserver/build.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:7: pin your Docker image by updating alpine:latest to alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: containerImage not pinned by hash: Dockerfile-tiny:1","Warn: containerImage not pinned by hash: Dockerfile-tiny:7: pin your Docker image by updating alpine:latest to alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   8 third-party GitHubAction dependencies pinned","Info:   0 out of   4 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T10:36:57.920Z","repository_id":71043575,"created_at":"2025-08-17T10:36:57.920Z","updated_at":"2025-08-17T10:36:57.920Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29270899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T13:47:44.167Z","status":"ssl_error","status_checked_at":"2026-02-09T13:47:43.721Z","response_time":56,"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":["go","golang","http-server","httpserver","static","static-site"],"created_at":"2024-10-02T07:00:59.029Z","updated_at":"2026-04-01T20:02:42.316Z","avatar_url":"https://github.com/byjg.png","language":"CSS","funding_links":["https://github.com/sponsors/byjg"],"categories":[],"sub_categories":[],"readme":"# Static http server\n\n[![Build Status](https://github.com/byjg/docker-static-httpserver/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/byjg/docker-static-httpserver/actions/workflows/build.yml)\n[![Opensource ByJG](https://img.shields.io/badge/opensource-byjg-success.svg)](http://opensource.byjg.com)\n[![GitHub source](https://img.shields.io/badge/Github-source-informational?logo=github)](https://github.com/byjg/docker-static-httpserver/)\n[![GitHub license](https://img.shields.io/github/license/byjg/docker-static-httpserver.svg)](https://opensource.byjg.com/opensource/licensing.html)\n[![GitHub release](https://img.shields.io/github/release/byjg/docker-static-httpserver.svg)](https://github.com/byjg/docker-static-httpserver/releases/)\n\nA really minimal HTTP/HTTPS Server image for static files written in Go.\n\n## Why?\n\n* Create a simple HTML website\n* Serve static files with HTTP and HTTPS (self-signed certificate by default)\n* SPA (Single Page Application) support for frontend frameworks like React, Angular, Vue\n* In-memory LRU file cache with configurable limits\n* Health check endpoint for Kubernetes probes\n* Really small footprint\n\n## How to use the \"Parking page\"?\n\nThe image includes a self-contained parking page (single HTML file, no external dependencies) that can be\ncustomized by setting the environment variables:\n\n* `HTML_TITLE` - Page title (default: \"Coming soon\")\n* `TITLE` - Main heading (default: \"soon\")\n* `MESSAGE` - Body message\n* `BG_IMAGE` - Background image URL\n* `FACEBOOK` - Facebook page URL\n* `TWITTER` - Twitter page URL\n* `YOUTUBE` - YouTube page URL\n\ne.g.\n\n```bash\ndocker run -p 8080:8080 -e TITLE=soon -e \"MESSAGE=Keep In Touch\" byjg/static-httpserver\n```\n\n## Configuration\n\nThe server can be configured via CLI flags or environment variables. CLI flags take precedence over environment variables.\n\n| CLI Flag           | Env Variable          | Default      | Description                                                                   |\n|--------------------|-----------------------|--------------|-------------------------------------------------------------------------------|\n| `--root-dir`       | `ROOT_DIR`            | *(required)* | Root directory for static files                                               |\n| `--port`           | `PORT`                | *(disabled)* | HTTP listening port. Not set = HTTP disabled                                  |\n| `--tls-port`       | `TLS_PORT`            | `8443`       | HTTPS listening port                                                          |\n| `--tls-cert-dir`   | `TLS_CERT_DIR`        | `/certs`     | Directory to look for `cert.pem` and `key.pem`                                |\n| `--spa`            | `SPA_MODE`            | `false`      | Enable SPA routing                                                            |\n| `--show-headers`   | `SHOW_HEADERS`        | `false`      | Display request headers on the parking page                                   |\n| `--cache-max-size` | `CACHE_MAX_SIZE`      | `50000000`   | Max total cache size in bytes (0 to disable)                                  |\n| `--cache-max-file` | `CACHE_MAX_FILE_SIZE` | `5000000`    | Max individual file size to cache in bytes                                    |\n| `--proxy`          | `PROXY_ROUTES`        | *(none)*     | Proxy route as `/prefix=http://target` (repeatable flag, comma-separated env) |\n| `--proxy-timeout`  | `PROXY_TIMEOUT`       | `30`         | Proxy upstream response timeout in seconds                                    |\n| `--version`        |                       |              | Print version and exit                                                        |\n\nThe Docker image sets `--root-dir /static` and `--port 8080` by default.\n\n### CLI Usage\n\n```bash\n# Serve current directory on HTTPS only (port 8443)\nstatic-httpserver --root-dir .\n\n# Serve with both HTTP and HTTPS\nstatic-httpserver --root-dir /var/www/html --port 8080\n\n# SPA mode\nstatic-httpserver --root-dir ./dist --port 3000 --spa\n```\n\n### Install via deb/rpm\n\n```bash\n# Debian/Ubuntu\napt install static-httpserver\n\n# RHEL/CentOS\nyum install static-httpserver\n```\n\n### HTTPS / TLS\n\nHTTPS is always enabled (default port 8443). By default, a **self-signed certificate** is generated\nin memory at startup.\n\nTo use your own certificates, provide a directory with `cert.pem` and `key.pem`:\n\n```bash\n# CLI\nstatic-httpserver --root-dir ./html --tls-cert-dir /path/to/certs\n\n# Docker\ndocker run -p 8080:8080 -p 8443:8443 \\\n    -v /path/to/certs:/certs:ro \\\n    byjg/static-httpserver\n```\n\nHTTP is **optional** — only started when `--port` or `PORT` is set.\n\n### SPA Mode\n\nWhen enabled, any request that doesn't match an existing file **and** has no file extension\nis served the `index.html` page. This supports client-side routing in frameworks like React, Angular, and Vue.\n\nRequests for missing static assets (e.g., `/missing.css`) still return 404.\n\n```bash\ndocker run -p 8080:8080 -e SPA_MODE=true byjg/static-httpserver\n```\n\n### Reverse Proxy\n\nThe server can forward requests matching a path prefix to a backend service. This is useful for:\n- Avoiding CORS issues by serving the frontend and API from the same origin\n- Hiding backend services from direct client access\n- Replacing nginx/caddy as a reverse proxy sidecar in Kubernetes\n\n```bash\n# CLI — multiple routes\nstatic-httpserver --root-dir ./dist --spa \\\n    --proxy /api=http://backend:3000 \\\n    --proxy /auth=http://auth-service:4000\n\n# Docker — comma-separated env\ndocker run -p 8080:8080 \\\n    -e SPA_MODE=true \\\n    -e PROXY_ROUTES=\"/api=http://backend:3000,/auth=http://auth:4000\" \\\n    byjg/static-httpserver\n```\n\nThe proxy strips the prefix before forwarding: a request to `/api/users` is forwarded as `/users` to the target.\n\nThe `--proxy-timeout` flag (default 30s) controls how long the server waits for a response from the upstream.\n\n### Health Check\n\nThe server exposes a `/health` endpoint that returns `{\"status\":\"ok\"}` with HTTP 200.\nThis is used by the Helm chart for Kubernetes liveness and readiness probes.\n\n## Using with Helm 3\n\n3.2. Using HELM 3\n\nMinimal configuration\n\n```bash\nhelm repo add byjg https://opensource.byjg.com/helm\nhelm repo update\nhelm upgrade --install mysite byjg/static-httpserver \\\n    --namespace default \\\n    --set \"ingress.hosts={www.example.org,example.org}\" \\\n    --set parameters.title=Welcome\n```\n\nParameters:\n\n```yaml\ningress:\n  hosts: []               # Required\nparameters:\n  htmlTitle: \"\"\n  title: \"soon\"\n  message: \"\"\n  backgroundImage: \"\"\n  facebook: \"\"\n  twitter: \"\"\n  youtube: \"\"\n  spaMode: \"\"\n  showHeaders: \"\"\n  rootDir: \"\"\n  port: \"\"\n  tlsPort: \"\"\n  tlsCertDir: \"\"\n  cacheMaxSize: \"\"\n  cacheMaxFileSize: \"\"\n```\n\n```tip\nThis HELM package is setup to work with [EasyHAProxy](https://github.com/byjg/docker-easy-haproxy)\n```\n\n## Enabling as Addon on MicroK8s\n\nThe Parking addon deploys a static webserver to ‘park’ a domain. This involves all\nnecessary ingress, service and Pods. This addon adds the proper labels which can be\ndiscovered by EasyHAProxy.\n\nTo enable this addon:\n\n```\nmicrok8s enable parking \u003cdomainlist\u003e\n```\n\n… where domainlist is the comma separated list of domains to be parked.\n\nTo disable the addon:\n\n```\nmicrok8s disable parking\n```\n\nFollow this discussion: [https://discuss.kubernetes.io/t/addon-parking/23186](https://discuss.kubernetes.io/t/addon-parking/23186)\n\n## Use your own static pages\n\nMount your own HTML directory to replace the default parking page:\n\n```bash\ndocker run -p 8080:8080 -v /path/to/local/html:/static byjg/static-httpserver\n```\n\n## Create your own image\n\n```dockerfile\nFROM byjg/static-httpserver\n\nCOPY /path/to/html /static\n```\n\n## Using with React / Vue / Angular (SPA)\n\nUse a multi-stage Dockerfile to build your frontend app and serve it with SPA routing:\n\n```dockerfile\nFROM node:22-alpine AS builder\nWORKDIR /app\nCOPY package.json package-lock.json ./\nRUN npm ci\nCOPY . .\nRUN npm run build\n\nFROM byjg/static-httpserver\nENV SPA_MODE=true\nCOPY --from=builder /app/build /static\n```\n\nNote: adjust the build output folder depending on your framework:\n- **React (CRA)**: `build`\n- **Vite**: `dist`\n- **Next.js (static export)**: `out`\n- **Angular**: `dist/\u003cproject-name\u003e/browser`\n\nThen build and run:\n\n```bash\ndocker build -t myapp .\ndocker run -p 8080:8080 myapp\n```\n\n----\n[Open source ByJG](http://opensource.byjg.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyjg%2Fdocker-static-httpserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyjg%2Fdocker-static-httpserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyjg%2Fdocker-static-httpserver/lists"}