Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Set Up an NGINX Reverse Proxy on Ubuntu 26.04 Without Docker

A practical Ubuntu 26.04 guide to proxying a host-installed HTTP app through NGINX, with site activation, URI mapping, HTTPS, and upstream TLS notes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To put an HTTP application behind NGINX on Ubuntu 26.04, install NGINX from Ubuntu’s packages, create a server block that sends requests to the application with proxy_pass, enable the site, test the configuration, and reload NGINX. This host-based guide assumes your application is already running and you know its listening address and port. Replace app.example.com and 127.0.0.1:8080 with your own hostname and upstream. For public access, DNS must point to this server and network rules must permit the required traffic.

1. Install NGINX and check the service

Ubuntu’s server documentation gives these commands for installing NGINX and checking its service status:

As an Amazon Associate I earn from qualifying purchases.

sudo apt update
sudo apt install nginx
sudo systemctl status nginx

APT installs the package from your configured Ubuntu repositories; the installed revision can change as updates are published. Check your Ubuntu release, repository configuration, and installed package rather than assuming a particular version. The NGINX package listing includes Ubuntu 26.04 “Resolute” for x86_64 and ARM64, but that does not guarantee a specific revision in every repository or on every host. Ubuntu: Install and configure NGINX · NGINX packages for Ubuntu

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Ubuntu Resolute manpage listing showed 1.28.3-2ubuntu1.10 at the time it was retrieved; treat that as a point-in-time package listing, not a version promise. Keep Ubuntu and NGINX security updates current. Ubuntu’s advisory for CVE-2026-1642 describes an issue involving NGINX proxying to upstream TLS servers and lists a fixed Resolute package version; consult the current advisory and your installed package status for up-to-date details. Ubuntu security notice: CVE-2026-1642 · Ubuntu Resolute NGINX manpage

2. Create a server block for the application

Ubuntu’s packaged layout keeps available site configurations in /etc/nginx/sites-available/ and activates them through symlinks in /etc/nginx/sites-enabled/. Create a file for the hostname:

sudo nano /etc/nginx/sites-available/app.example.com

For an application listening on HTTP at 127.0.0.1:8080 on the same server, use this basic configuration:

server {
    listen 80;
    listen [::]:80;
    server_name app.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

server_name must match the hostname clients request, and the address in proxy_pass must be where the application actually listens. Use a reachable private or public address instead of loopback if the upstream runs on another machine. NGINX’s reverse-proxy guide describes proxying as a way to distribute load among servers, serve content from different websites, or pass requests to application servers over other protocols. NGINX: ngx_http_proxy_module · NGINX: Reverse proxy

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Choose how NGINX maps request paths

The slash—or lack of one—at the end of proxy_pass changes URI handling when it includes a URI component. With location /, proxy_pass http://127.0.0.1:8080; has no URI after the upstream address, so NGINX passes the request URI through. A request for /orders/42 reaches the upstream as /orders/42.

If instead you configure location /app/ with proxy_pass http://127.0.0.1:8080/;, the slash after the upstream address supplies a URI. NGINX replaces the part of the request URI that matches the location: a request for /app/orders/42 is sent upstream as /orders/42. This is useful when the application expects to run at the root path, but wrong if it expects the /app/ prefix. Choose the form that matches the application’s base path. NGINX: proxy_pass URI handling

4. Enable the site, test, and reload

Create the enabling symlink, validate the NGINX configuration, and reload the service only if the test succeeds:

sudo ln -s /etc/nginx/sites-available/app.example.com /etc/nginx/sites-enabled/app.example.com
sudo nginx -t
sudo systemctl reload nginx

nginx -t checks configuration syntax and can report file or directive errors; it does not verify that the upstream application is healthy or reachable. If the test fails, fix the reported problem and run it again before reloading. Ubuntu documents the available/enabled symlink layout and the reload workflow. Ubuntu: NGINX site configuration and service management

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the default server block answers instead of your new site, inspect the enabled configurations and their server names. Disable the default site only after checking whether it serves an existing site or is needed for other hostnames; do not remove it blindly. To inspect the service after reloading, use sudo systemctl status nginx. Then request the hostname and check both the response and NGINX’s error log if the application does not appear.

5. Make the hostname reachable

For a public hostname, create or update its DNS record to point to the server and make sure the server’s firewall and any upstream network firewall allow inbound HTTP traffic. The application must be listening on the configured upstream address and port. A local-only application bound to 127.0.0.1 is reachable from NGINX on the same host, not directly from remote clients.

For an internal-only service, use the appropriate private DNS and network access. A public certificate is not required for a private HTTP test, though browser-to-proxy encryption may still be important for a service used over an untrusted network.

6. Add HTTPS for a public hostname (optional)

Ubuntu documents Certbot, installed as a snap, as an ACME client for obtaining certificates and configuring NGINX. Once the domain points to the server and the required public validation traffic can reach it, install Certbot and request a certificate for your actual hostname:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo snap install --classic certbot
sudo certbot --nginx -d app.example.com

For a second hostname such as www.app.example.com, include another -d option only if its DNS also points to this server and you intend to serve it. The NGINX plugin finds matching server blocks, adds TLS directives, and reloads NGINX. Certificate issuance depends on the domain and validation path being suitable; the command does not make an unconfigured or unreachable domain eligible. Ubuntu: Configure NGINX with TLS certificates

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

7. If the upstream itself uses HTTPS

Browser-to-NGINX HTTPS and NGINX-to-upstream HTTPS are separate connections. Setting an upstream URL to https:// encrypts transport, but NGINX’s proxy module documents certificate verification as off by default. For a remote or otherwise untrusted HTTPS upstream, configure verification deliberately: provide the appropriate trust roots with proxy_ssl_trusted_certificate, enable verification with proxy_ssl_verify on;, and use proxy_ssl_server_name on; when the upstream relies on SNI. Ensure the certificate name and trust chain match the upstream. Do not treat an encrypted connection alone as proof that NGINX is talking to the intended server. NGINX: proxy_ssl_verify and related proxy TLS directives

8. Add application-specific proxy settings only when needed

The minimal block above is not a universal application configuration. NGINX changes the proxied Host and Connection headers by default; the example explicitly passes the requested host and client address. Some applications also need the original scheme or a forwarded client-address chain to generate correct redirects, URLs, or logs. Configure those headers to suit the application, and configure the application to trust only the proxy addresses it should trust. Forwarded headers supplied by clients are not automatically trustworthy.

Other settings depend on the application rather than on reverse proxying in general:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • WebSockets: add the appropriate upgrade handling if the application uses WebSocket connections.
  • Request body size: adjust the body-size limit if legitimate uploads exceed the configured limit.
  • Timeouts or buffering: tune them only when the application’s response behavior requires it.
  • Base paths: confirm whether the app serves at / or expects a prefix, then match the location and proxy_pass URI behavior.

NGINX’s proxy documentation explains the available directives, but the correct values depend on the backend’s behavior and trust model. NGINX: ngx_http_proxy_module

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.