Skip to content

398 - Nginx Snippet

Nginx server block as raw string configuration. This is an example of a MAML document.

maml
# Nginx configuration
{
  name: "fearless-apricot.com"
  # Server block
  config: """
server {
    listen 443 ssl http2;
    server_name bustling-scorn.biz;

    ssl_certificate /etc/ssl/certs/cert.pem;
    ssl_certificate_key /etc/ssl/private/key.pem;

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

    location /static/ {
        root /var/www/html;
        expires 30d;
    }
}
"""

  enabled: true
  reload_command: "nginx -t && systemctl reload nginx"
}

See Also