Skip to content

Lime CRM Web Server

Lime Web Server is a Python server responsible of:

  • serving endpoints
  • serving static files
  • setting up https/tls correctly

In a vanilla Lime CRM Server installation, endpoints for the webclient and REST API are registered on the server. You can add your own custom endpoints to the web server via custom endpoints.

Configuration

The Web Server can be configured as:

debug: # Turn on to get profiling of performance
    profile: False

globals:
    secret_key: # Secret key here
    use_ssl: True
    https_port: 5442
    http_port: 5442
    max_content_length: 55
    database_driver: SQL Server Native Client 11.0
    lime_version: Unversioned
    ldc_hostname: localhost

cheroot: # Cheroot is used as the web server for on-premise installations
    numthreads: 30
    max: 30
    timeout: 2

features:
    webclient_login: True
    hosting_webclient_login: False
    reset_password: False
    execution_context: False

logging:
    level: warning
    json: False
    accesslog: True
    accesslogname: default_accesslog
    add_timed_log_rotation: False

mail: # This is settings to use "restore password feature"
    sender_name: The Lime CRM team
    sender_email: [email protected]
    api_url:  # Lime Marketing URL
    api_key:  # Lime Marketing API Key
    user_email: # Lime Markting user

ssl:
    cert: default_certfile
    privkey: default_privkey

webserver:
    list_applications: False

webserver.list_applications

Enables the "select database" feature in the login screen. Set this to true for on-premise installations with more than one application.

Configuring a Reverse Proxy for Lime CRM Webserver

When deploying Lime CRM behind a reverse proxy, it's crucial to ensure that the proxy forwards the correct headers to the Lime CRM web server. This is necessary for generating accurate absolute URLs and properly handling redirects.

Required Headers

Make sure your reverse proxy is configured to include the following headers in every request to the Lime CRM web server:

  • X-Forwarded-Proto: Specifies the original protocol (http or https) used by the client.
  • X-Forwarded-Host: Specifies the external domain the client used to access the application.

Example Configuration (Nginx)

server {
    listen 80;
    server_name lime.yourdomain.com;

    location / {
        proxy_pass http://lime-crm;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Why These Headers Are Important

Without these headers, the Lime CRM server will assume it is directly accessible, potentially generating URLs like http://lime-crm/ instead of the correct, externally accessible https://lime.yourdomain.com/. This can lead to:

  • Broken links in the UI
  • Incorrect redirects
  • Inconsistent behavior in client applications

Ensure these headers are correctly forwarded to avoid these issues and provide a seamless user experience.