https://github.com/nginx/unit Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Customer Stories + White papers, Ebooks, Webinars + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} nginx / unit Public * Notifications * Fork 291 * Star 3.7k NGINX Unit - universal web app server - a lightweight and versatile open source server project that works as a reverse proxy, serves static assets, and runs applications in multiple languages. unit.nginx.org License Apache-2.0 license 3.7k stars 291 forks Activity Star Notifications * Code * Issues 189 * Pull requests 9 * Actions * Security * Insights More * Code * Issues * Pull requests * Actions * Security * Insights nginx/unit This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 6 branches 75 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/n] Use Git or checkout with SVN using the web URL. [gh repo clone nginx/] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @alejandro-colomar @ac000 alejandro-colomar and ac000 Log: fixed typo. ... 7dd5ad9 Sep 7, 2023 Log: fixed typo. Scripted change: $ grep -ril recevied src/ | xargs sed -i s/recevied/received/ Reported-by: Closes: <#920> Cc: Cc: Timo Stark Signed-off-by: Alejandro Colomar Reviewed-by: Andrew Clayton Signed-off-by: Andrew Clayton 7dd5ad9 Git stats * 2,430 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time auto Added unit pkg-config file. August 1, 2023 10:16 docs Version bump. September 4, 2023 12:03 go Tests: using modules in Go. January 10, 2022 16:07 pkg Generated Dockerfiles for Unit 1.31.0. August 23, 2023 11:29 src Log: fixed typo. September 7, 2023 23:13 test Tests: added tests for the "response_headers" option. September 4, 2023 12:25 tools Tools: setup-unit: ctl: added "edit" subcommand. June 30, 2023 14:35 .gitattributes Set git diff driver for C source code files. October 26, 2022 01:23 .gitignore Added .gitignore. May 3, 2022 12:41 .hgignore Added .hgignore file. September 18, 2020 19:37 .hgtags Fixed tag for 1.31.0 release. August 30, 2023 09:07 .mailmap Using names in .mailmap. May 21, 2023 01:06 CHANGES Added version 1.31.0 CHANGES. August 28, 2023 17:51 CODE_OF_CONDUCT.md Adding the NGINX Code of Conduct to the repo. March 7, 2023 13:05 CONTRIBUTING.md Adding GitHub-styled README and CONTRIBUTING files in Markdown. May 13, 2022 17:13 LICENSE Added LICENSE and NOTICE files. September 6, 2017 18:26 NOTICE Updated copyright notice. May 24, 2023 16:27 README.md Update README.md for Docker Official Image. August 1, 2023 16:06 SECURITY.txt Added security.txt. November 24, 2022 15:06 configure Added unit pkg-config file. August 1, 2023 10:16 version Version file bump. September 4, 2023 14:06 View code [ ] NGINX Unit Universal Web App Server Quick Installation macOS Docker Amazon Linux, Fedora, RedHat Debian, Ubuntu Running a Hello World App OpenAPI Specification Community README.md NGINX Unit Universal Web App Server NGINX Unit Logo NGINX Unit is a lightweight and versatile open-source server that has two primary capabilities: * serves static media assets, * runs application code in seven languages. Unit compresses several layers of the modern application stack into a potent, coherent solution with a focus on performance, low latency, and scalability. It is intended as a universal building block for any web architecture regardless of its complexity, from enterprise-scale deployments to your pet's homepage. Its native RESTful JSON API enables dynamic updates with zero interruptions and flexible configuration, while its out-of-the-box productivity reliably scales to production-grade workloads. We achieve that with a complex, asynchronous, multithreading architecture comprising multiple processes to ensure security and robustness while getting the most out of today's computing platforms. Quick Installation macOS $ brew install nginx/unit/unit For details and available language packages, see the docs. Docker $ docker pull unit For a description of image tags, see the docs. Amazon Linux, Fedora, RedHat $ wget https://raw.githubusercontent.com/nginx/unit/master/tools/setup-unit && chmod +x setup-unit # ./setup-unit repo-config && yum install unit # ./setup-unit welcome For details and available language packages, see the docs. Debian, Ubuntu $ wget https://raw.githubusercontent.com/nginx/unit/master/tools/setup-unit && chmod +x setup-unit # ./setup-unit repo-config && apt install unit # ./setup-unit welcome For details and available language packages, see the docs. Running a Hello World App Unit runs apps in a variety of languages. Let's consider a basic example, choosing PHP for no particular reason. Suppose you saved a PHP script as /www/helloworld/index.php: To run it on Unit with the unit-php module installed, first set up an application object. Let's store our first config snippet in a file called config.json: { "helloworld": { "type": "php", "root": "/www/helloworld/" } } Saving it as a file isn't necessary, but can come in handy with larger objects. Now, PUT it into the /config/applications section of Unit's control API, usually available by default via a Unix domain socket: # curl -X PUT --data-binary @config.json --unix-socket \ /path/to/control.unit.sock http://localhost/config/applications { "success": "Reconfiguration done." } Next, reference the app from a listener object in the /config/ listeners section of the API. This time, we pass the config snippet straight from the command line: # curl -X PUT -d '{"127.0.0.1:8000": {"pass": "applications/helloworld"}}' \ --unix-socket /path/to/control.unit.sock http://localhost/config/listeners { "success": "Reconfiguration done." } Now Unit accepts requests at the specified IP and port, passing them to the application process. Your app works! $ curl 127.0.0.1:8080 Hello, PHP on Unit! Finally, query the entire /config section of the control API: # curl --unix-socket /path/to/control.unit.sock http://localhost/config/ Unit's output should contain both snippets, neatly organized: { "listeners": { "127.0.0.1:8080": { "pass": "applications/helloworld" } }, "applications": { "helloworld": { "type": "php", "root": "/www/helloworld/" } } } For full details of configuration management, see the docs. OpenAPI Specification Our OpenAPI specification aims to simplify configuring and integrating NGINX Unit deployments and provide an authoritative source of knowledge about the control API. Although the specification is still in the early beta stage, it is a promising step forward for the NGINX Unit community. While working on it, we kindly ask you to experiment and provide feedback to help improve its functionality and usability. Community * The go-to place to start asking questions and share your thoughts is our Slack channel. * Our GitHub issues page offers space for a more technical discussion at your own pace. * The project map on GitHub sheds some light on our current work and plans for the future. * Our official website may provide answers not easily found otherwise. * Get involved with the project by contributing! See the contributing guide for details. * To reach the team directly, subscribe to the mailing list. * For security issues, email us, mentioning NGINX Unit in the subject and following the CVSS v3.1 spec. About NGINX Unit - universal web app server - a lightweight and versatile open source server project that works as a reverse proxy, serves static assets, and runs applications in multiple languages. unit.nginx.org Resources Readme License Apache-2.0 license Code of conduct Code of conduct Activity Stars 3.7k stars Watchers 124 watching Forks 291 forks Report repository Contributors 28 * @VBart * @mar0x * @andrey-zelenkov * @igorsysoev * @thresheek * @defanator * @ac000 * @alejandro-colomar * @hongzhidao * @lexborisov * @ocanty + 17 contributors Languages * C 62.8% * Java 16.5% * Python 14.3% * JavaScript 1.9% * Shell 1.2% * C++ 1.0% * Other 2.3% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.