NGINX Configuration Guide
This guide walks you through setting up an Nginx web server on Ubuntu 22.04 with:
A reverse proxy configuration where yourwebsite.com/hash points to hash.yourwebsite.com
HTTPS support using Let’s Encrypt via Certbot
Prerequisites
A server running Ubuntu 22.04
A registered domain name (e.g., yourwebsite.com )
DNS A record pointing yourwebsite.com to your server’s IP
Step 1: Install Nginx
sudo apt update
sudo apt install nginx -yStart and enable Nginx:
sudo systemctl start nginx
sudo systemctl enable nginxStep 2: Configure Nginx Server Block for yourwebsite.com
Create a new config file:
Paste the following content:
Enable the configuration:
Step 3: (Optional) Install Certbot and Nginx Plugin
Step 4: (Optional) Obtain SSL Certificate with Certbot
Replace yourwebsite.com with your actual domain:
Certbot will:
Automatically configure HTTPS in your Nginx config
Enable HTTP to HTTPS redirection
Reload Nginx automatically
Step 5: Verify Setup
Test the proxy by visiting:
It should forward the request to:
Step 6: (Optional) Test Auto-Renewal
Verify Certbot renewal service:
Simulate a dry run renewal:
Conclusion
You now have:
Nginx running on Ubuntu 22.04
HTTPS enabled via Let’s Encrypt
A reverse proxy from yourwebsite.com/hash to hash.yourwebsite.com
After enabling Cookie lifetime extender, the DCP will give a proxy code that is expected to be setup on https://domain.*/hash however, if it is set up on https://www.domain.*/hash it will cause a CORS Error on the Cookie Lifetime Extender Requests.
If you have any questions or feedback, please open a request on our Helpdesk.
Last updated
Was this helpful?