NGINX
Generated on 3 Jan 2023 from the NGINX catalog page
NGINX is an open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more. It started out as a web server designed for maximum performance and stability. In addition to its HTTP server capabilities, NGINX can also function as a proxy server for email (IMAP, POP3, and SMTP) and a reverse proxy and load balancer for HTTP, TCP, and UDP servers.
Software Included
Package | Version | License |
---|---|---|
nginx | 1.23.3 | BSD-2-Clause |
Creating an App using the Control Panel
Click the Deploy to DigitalOcean button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account.
Creating an App using the API
In addition to creating a Droplet from the NGINX 1-Click App using the control panel, you can also use the DigitalOcean API. As an example, to create a 4GB NGINX Droplet in the SFO2 region, you can use the following curl
command. You need to either save your API access token) to an environment variable or substitute it in the command below.
curl -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$TOKEN'' -d \
'{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image": "nginx"}' \
"https://api.digitalocean.com/v2/droplets"
Getting Started After Deploying NGINX
How to use this Droplet
Log into the Droplet
If you’ve setup an SSH key while launching the Droplet, use ssh -i <ssh_key> <user>@<your_droplet_public_ipv4>
.
Otherwise, if you’ve setup a user and password, use ssh <user>@<your_droplet_public_ipv4>
to log into the instance.
Check NGINX is working
Before you start tweaking NGINX, make sure it is indeed present and working. Run curl <your_droplet_public_ipv4>
or open the IP address on your web browser of choice. If NGINX is running, you should be greeted with the default “Welcome to nginx!” landing page.
Configure NGINX
Detailing how to configure NGINX would take more space than what’s available here. As such, we recommend you check our Beginner’s Guide and our full module reference documentation available at https://nginx.org/en/docs/.
Configure Firewall
In addition to installing NGINX, this 1-Click also enables the UFW firewall to allow only SSH (port 22, rate limited), HTTP (port 80), and HTTPS (port 443) access. We recommend you tweak your environment to further restrict SSH access to the droplet.
Need help?
Have a question about how to use NGINX? Want to chat with like minded fellows? Join our NGINX community Slack!
Alternatively, feel free to reach out to the NGINX team using the NGINX mailing list!