Skip to content

082 - Nginx Snippet

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

maml
# Nginx configuration
{
  name: "last-masterpiece.net"
  # Server block
  config: """
server {
    listen 443 ssl http2;
    server_name next-forgery.name;

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

    location / {
        proxy_pass http://localhost:3313;
        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