Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JReyna217/AutoLog/llms.txt

Use this file to discover all available pages before exploring further.

AutoLog uses Nginx at two distinct layers. The autolog-web Docker container bundles its own Nginx instance to serve the compiled Angular SPA and handle client-side routing. On top of that, an outer Nginx process running directly on the Ubuntu host acts as a reverse proxy: it terminates SSL, redirects HTTP traffic to HTTPS, and forwards requests to the appropriate Docker container ports. This separation means the inner Nginx handles application concerns while the outer Nginx handles infrastructure concerns.

Prerequisites

  • Ubuntu Server with Nginx installed (sudo apt install nginx)
  • A domain name pointed at your server’s public IP
  • An SSL certificate and private key available on the server (see the Certbot tip below for a free option)
  • AutoLog containers already running (see the Docker deployment guide)

Configuring the Reverse Proxy

1

Create the site configuration file

Create a new Nginx server block at /etc/nginx/sites-available/autolog:
sudo nano /etc/nginx/sites-available/autolog
Paste in the following configuration, replacing the placeholders with your actual domain name and certificate paths:
server {
    listen 80;
    server_name autolog.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name autolog.yourdomain.com;

    ssl_certificate /etc/nginx/ssl/your_cert.crt;
    ssl_certificate_key /etc/nginx/ssl/your_key.key;

    location / {
        proxy_pass http://127.0.0.1:5020;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
2

Enable the site

Create a symlink from sites-available to sites-enabled:
sudo ln -s /etc/nginx/sites-available/autolog /etc/nginx/sites-enabled/
3

Test the configuration

Validate the Nginx configuration before reloading to catch any syntax errors:
sudo nginx -t
A successful test will output syntax is ok and test is successful.
4

Reload Nginx

Apply the new configuration with a graceful reload (no downtime):
sudo systemctl reload nginx
Remember to replace the following placeholders in the configuration above before saving:
  • autolog.yourdomain.com — your actual domain name (must match your DNS record)
  • /etc/nginx/ssl/your_cert.crt — the absolute path to your SSL certificate file
  • /etc/nginx/ssl/your_key.key — the absolute path to your SSL private key file
  • 5020 — the host port your autolog-web container is bound to (default from the Docker guide)

Internal Container Nginx

The autolog-web container ships with its own nginx.conf that handles Angular SPA routing and static asset caching. The key directive is try_files $uri $uri/ /index.html, which ensures that direct navigation to any Angular route (e.g., /fuel-logs/123) returns index.html instead of a 404 — letting the Angular Router handle the URL client-side.
server {
    listen 80;
    server_name localhost;

    location / {
        root /usr/share/nginx/html;
        index index.html index.htm;
        # Crucial for Angular: redirects all requests to index.html
        try_files $uri $uri/ /index.html;
    }

    # Optimization: Cache static assets like images and fonts
    location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg)$ {
        root /usr/share/nginx/html;
        expires 6M;
        access_log off;
        add_header Cache-Control "public";
    }

    # Security: Disable version tokens
    server_tokens off;
}
This file is baked into the image at build time (copied to /etc/nginx/conf.d/default.conf). You do not need to modify it unless you are building a custom frontend image.
Let’s Encrypt with Certbot is the easiest way to get a free, auto-renewing SSL certificate for your domain. Install it with sudo apt install certbot python3-certbot-nginx, then run sudo certbot --nginx -d autolog.yourdomain.com. Certbot will automatically edit your Nginx configuration and configure certificate renewal via a systemd timer.

Build docs developers (and LLMs) love