{"id":30067296,"url":"https://github.com/jas0n0ss/nginx-migration","last_synced_at":"2026-05-13T23:37:56.863Z","repository":{"id":290533434,"uuid":"974765507","full_name":"Jas0n0ss/nginx-migration","owner":"Jas0n0ss","description":"nginx server backup \u0026 restore script for offline migration.","archived":false,"fork":false,"pushed_at":"2025-07-20T02:56:59.000Z","size":21905,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T09:02:54.347Z","etag":null,"topics":["migration","nginx","offline","rpm","rpmbuild"],"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/Jas0n0ss.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,"zenodo":null}},"created_at":"2025-04-29T09:18:04.000Z","updated_at":"2025-07-20T02:57:03.000Z","dependencies_parsed_at":"2025-04-29T10:29:53.679Z","dependency_job_id":"e78f9675-bc06-44bd-b3dd-138ca70d9a6f","html_url":"https://github.com/Jas0n0ss/nginx-migration","commit_stats":null,"previous_names":["jas0n0ss/ngx_backup_restore","jas0n0ss/ngx-migration","jas0n0ss/nginx-migration"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Jas0n0ss/nginx-migration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jas0n0ss%2Fnginx-migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jas0n0ss%2Fnginx-migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jas0n0ss%2Fnginx-migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jas0n0ss%2Fnginx-migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jas0n0ss","download_url":"https://codeload.github.com/Jas0n0ss/nginx-migration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jas0n0ss%2Fnginx-migration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011281,"owners_count":26084928,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["migration","nginx","offline","rpm","rpmbuild"],"created_at":"2025-08-08T08:54:58.438Z","updated_at":"2025-10-12T12:11:51.188Z","avatar_url":"https://github.com/Jas0n0ss.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NGINX / Tengine RPM with Dynamic Modules \u0026 LuaJIT\n\n## 🚀 Features\n\nThis custom RPM includes (based on version selected):\n\n- **NGINX 1.x.x** or **Tengine 3.x.x**\n- Dynamic modules:\n  - `ngx_http_geoip2_module` (GeoIP2 support)\n  - `nginx-module-vts` (traffic monitoring)\n  - `ngx_devel_kit` (for Lua support)\n  - `lua-nginx-module` (Lua scripting support)\n- Lua libraries:\n  - `lua-resty-core`\n  - `lua-resty-lrucache`\n- Systemd service integration\n- Built with **LuaJIT**\n\n------\n\n## 📦 Installation\n\n```bash\n# Install the RPM (example for NGINX):\nsudo dnf localinstall nginx-1.25.0-1.x86_64.rpm\n\n# Or for Tengine:\nsudo dnf localinstall tengine-3.1.0-1.x86_64.rpm\n```\n\nEnable and start the service:\n\n```bash\nsudo systemctl enable --now nginx\n```\n\n------\n\n## 🔧 How to Build\n\n### 1. Install Dependencies\n\n```bash\n# Centos or RedHat 9\ndnf install -y epel-release\ndnf config-manager --set-enabled crb\ndnf groupinstall -y \"Development Tools\"\ndnf install -y gcc gcc-c++ make autoconf automake libtool \\\n    pcre pcre-devel zlib zlib-devel openssl openssl-devel \\\n    libaio-devel libatomic libatomic_ops-devel \\\n    libmaxminddb libmaxminddb-devel \\\n    gperftools gperftools-devel \\\n    luajit luajit-devel \\\n    perl-devel perl-ExtUtils-Embed \\\n    wget unzip git which \\\n    perl readline-devel systemd-devel\n```\n\n### 2. Prepare SPEC File\n\nSave the correct spec file to:\n\n```bash\nrpmdev-setuptree\n# For NGINX\ncp nginx.spec ~/rpmbuild/SPECS/nginx.spec\n# For Tengine\ncp tengine.spec ~/rpmbuild/SPECS/tengine.spec\n```\n\n------\n\n### 3. Build with `build.sh` Script\n\nThe script automatically detects whether to use `nginx.spec` or `tengine.spec` based on the environment variable `TENGINE`.\n\n```bash\n# build.sh --help\nNGINX=1.25.0 ./build.sh\nTENGINE=3.1.0 ./build.sh\n#\nTENGINE=3.1.0 GEOIP2=3.4 VTS=0.2.4 \\\nDEVEL_KIT=0.3.4 LUA_NGINX=0.10.28 LUA_RESTY_CORE=0.1.24 \\\nLUA_RESTY_LRUCACHE=0.13 ./build.sh\n```\n\n\u003e 💡 At least one of `NGINX` or `TENGINE` must be defined.\n\u003e The script will automatically choose `nginx.spec` or `tengine.spec` accordingly.\n\n------\n\n### 4. RPM Output\n\nAfter building, you'll find the RPM(s) here:\n\n```bash\n~/rpmbuild/RPMS/x86_64/\n```\n\n### 5. Backup \u0026 Install Nginx\n\n```bash\n# backup \ntar cvzf /tmp/`hostname`-conf-data.tgz /etc/nginx /data/static\n# restore\ntar xf \u003chostname\u003e-conf-data.tgz \ncp -r etc/nginx /etc \u0026\u0026 cp -r data/static /data\nwget https://github.com/Jas0n0ss/nginx-migration/releases/download/nginx/nginx-1.28.0-1.el9.x86_64.rpm\nsudo dnf localinstall nginx-1.28.0-1.el9.x86_64.rpm -y\nsudo systemctl enable --now nginx\nsudo systemctl status nginx \n```\n\n### 6. Enable Dynamic Modules (if needed)\n\nEdit `/etc/nginx/nginx.conf` and add at the top:\n\n```nginx\nload_module modules/ngx_http_geoip2_module.so;\nload_module modules/ndk_http_module.so;\nload_module modules/ngx_http_lua_module.so;\nload_module modules/ngx_http_vhost_traffic_status_module.so;\n```\n\n### 7. Notes\n\n- Make sure the `nginx` command is available for backup.\n- Restore will overwrite config and static files in the target directory. Ensure data safety before proceeding.\n- It is recommended to stop Nginx before restoring and start it after.\n- Static directory is optional; if not present, it will be skipped.\n- For more features and parameters, see [backup-restore/README.md](backup-restore/README.md) and [rpmbuild/README.md](rpmbuild/README.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjas0n0ss%2Fnginx-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjas0n0ss%2Fnginx-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjas0n0ss%2Fnginx-migration/lists"}