Skip to main content

Custom Nginx Configuration

Appliku automatically generates an Nginx configuration for each application, handling SSL termination, reverse proxying, and domain routing. You can override this with a custom configuration directly from the dashboard.

Enabling Custom Nginx Configuration

  1. Go to your application's Settings > Nginx tab
  2. Enable Use Custom Nginx Configuration
  3. The editor appears, pre-populated with the full Nginx configuration currently generated for your application

The pre-populated config includes your current proxy pass settings, upstream definitions, volume mounts, and domain configuration — giving you a complete starting point.

warning

Once custom config is enabled, new volumes you add to the application will not be automatically reflected in the Nginx config. You must update the configuration manually whenever you add or change volumes.

Editing the Configuration

The configuration editor shows your full Nginx config. Edit it to add your customizations, then click Save. The configuration is stored in the database and applied on the next deployment.

To apply changes immediately without a full redeploy, use the Reload button on the Server > Nginx tab. After reload, check the Config validity status to confirm the config is valid.

Controlling Auto-Update Behavior

The Update Nginx Configuration on Deploy checkbox (also in the Nginx tab) controls whether Appliku regenerates the Nginx config on each deployment.

  • Enabled (default) — Appliku regenerates the config on every deploy, keeping it in sync with your domain and process settings
  • Disabled — your custom config is preserved across deployments; domain and volume changes will not be automatically reflected

When using a custom config, you typically want to keep Update Nginx Configuration on Deploy enabled so that managed sections (SSL, upstream definitions) stay current, while your custom directives in the editable area are preserved.

Common Customizations

Increase Upload Size Limit

The default client_max_body_size may be too small for applications that handle large file uploads:

client_max_body_size 100M;

Increase Proxy Timeouts

For long-running requests (e.g., report generation, file processing):

proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;

Add Custom Headers

Add security or caching headers:

add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;

Enable Gzip Compression

Compress responses to reduce bandwidth usage:

gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
gzip_min_length 1000;

Checking for Config Errors

After saving a custom config, you can verify it before deploying:

  1. Go to Server > Nginx tab
  2. Click Reload
  3. Check the Config validity status — if there is a syntax error, it will appear in the error log below

This lets you catch and fix problems from the dashboard without needing SSH access.

Reverting to the Auto-Generated Configuration

To go back to the fully managed Nginx configuration:

  1. Disable Use Custom Nginx Configuration in Application Settings > Nginx tab
  2. Ensure Update Nginx Configuration on Deploy is enabled
  3. Trigger a new deployment

Appliku will regenerate the Nginx configuration from scratch based on your current application settings.