Nuggan can be deployed as a standalone service or on serverless platforms like AWS Lambda.
Best Practice: Access a deployed Nuggan through a CDN for optimal performance and caching.
Deploy Nuggan as a standalone HTTP service behind a reverse proxy, load balancer, or directly:
./nuggan -server ':8080' -server-config server.conf
See Usage Guide for configuration options and examples.
See the Usage Guide — Docker section for containerized deployment instructions.
Deploy Nuggan as a Go Lambda Handler on AWS.
Create a compatible AWS Lambda deployment package:
./scripts/aws-lambda-build.sh
This generates a ZIP file compatible with the Go 1.x runtime.
In the AWS Management Console:
nuggan-image-optimizer)Go 1.xIn the created function page:
Upload a .zip file.nuggan.sh.
In the AWS Management Console:
Lambdanuggan-api)In the Create and configure routes screen:
/{proxy+} (this forwards all requests to the Lambda function)In the Create and configure stages screen, keep the default values and click Create.

Your Nuggan service is now deployed and accessible through the API Gateway endpoint. Use the endpoint URL provided by API Gateway to make image requests.
Example request:
https://<api-gateway-id>.execute-api.us-east-1.amazonaws.com/optimg/0/0/-/-/-/-/-/_2_L3BvcHRvY2F0X3YyLnBuZw==/image.png
Replace the base URL and parameters as needed for your use case.