A static web server in a strictly confined snap. Install it and nginx serves a page on port 8080 right away. Then choose how to serve your own site.
Serve a git repository (no build needed)
Point the snap at a public repository with your static files. It fetches the latest commit and serves it. It can also follow the branch as you push, and roll back with one command:
sudo hello-nginx deploy https://github.com/me/my-site.git
sudo hello-nginx deploy https://github.com/me/my-site.git --path public
sudo hello-nginx auto-update 15m
sudo hello-nginx rollback
Branches can serve as environments: staging servers follow one branch, production servers another.
Or ship your site as its own snap
hello-nginx is also a template. Build your website into a snap of your own, and the content is versioned with the server. Go to the project repository (open source, MIT license) and use it as a template for your own site. The benefits of a website inside a snap:
snap refresh swaps the site and nginx together, so nobody sees a half-copied site.snap revert my-site brings back the previous site.edge can be staging and stable production, with snapcraft release as the promotion step.snap install my-site, with no setup steps after it.Source, template and documentation: https://github.com/carlosbravoa/hello-nginx
Manage the server
sudo hello-nginx port 80
sudo hello-nginx restart
hello-nginx status
sudo hello-nginx logs -f
Settings also work with snap set, which suits automation and cloud-init:
sudo snap set hello-nginx port=80 git.repo=https://github.com/me/my-site.git
You are about to open
Do you wish to proceed?
Thank you for your report. Information you provided will help us investigate further.
There was an error while sending your report. Please try again later.
Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.
Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.
Snap can be installed on elementary OS from the command line. Open Terminal from the Applications launcher and type the following:
sudo apt update
sudo apt install snapd
Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.
To install Hello nginx, simply use the following command:
sudo snap install hello-nginx --edge
Browse and find snaps from the convenience of your desktop using the snap store snap.
Interested to find out more about snaps? Want to publish your own application? Visit snapcraft.io now.