Example Configuration Files

Different services in Liferay Cloud (such as the search and web server services) use configuration files to perform what you might be used to handling differently in an on-premises environment. Here are some example resources you can use as a starting point to see what these files look like when you are getting started with Liferay Cloud.

Web Server Service Configuration (nginx.conf)

The web server service uses an Nginx server to manage web traffic. Here is an example nginx.conf file:

user  nginx;
worker_processes  2;

load_module modules/ngx_http_headers_more_filter_module.so;
load_module modules/ngx_http_auth_spnego_module.so;

error_log  /var/log/nginx/error.log ${ERROR_LOG_LEVEL};
pid        /tmp/nginx.pid;

events {
    worker_connections  10000;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '${LCP_WEBSERVER_LOG_FORMAT}';

    access_log  /var/log/nginx/access.log main;

    more_clear_headers Server;
    server_tokens   off;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    gzip  on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types  text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    server_names_hash_bucket_size 64;
    client_max_body_size 0;

    upstream upstream_server {
        keepalive 7000;
        server ${PROXY_ADDRESS};
    }

    server {
        listen 80 default_server;
        large_client_header_buffers 4 32k;

        if ($http_x_forwarded_proto = "http") {
            return 301 https://$host$request_uri;
        }

        proxy_connect_timeout ${LCP_WEBSERVER_GLOBAL_TIMEOUT};
        proxy_read_timeout ${LCP_WEBSERVER_GLOBAL_TIMEOUT};
        proxy_send_timeout ${LCP_WEBSERVER_GLOBAL_TIMEOUT};
        proxy_max_temp_file_size ${LCP_WEBSERVER_PROXY_MAX_TEMP_FILE_SIZE};

        include /etc/nginx/conf.d/*.conf;

        location /nginx_status {
            access_log ${NGINX_STATUS_ACCESS_LOG};
            stub_status on;

            proxy_connect_timeout ${LCP_WEBSERVER_GLOBAL_TIMEOUT};
            proxy_read_timeout ${LCP_WEBSERVER_GLOBAL_TIMEOUT};
            proxy_send_timeout ${LCP_WEBSERVER_GLOBAL_TIMEOUT};

            allow 10.0.0.0/8;
            deny all;
        }
    }

    set_real_ip_from 10.0.0.0/0;
    real_ip_header X-Forwarded-For;
    real_ip_recursive on;
}

The nginx.conf file belongs in the webserver/configs/[ENV]/conf.d/ directory in your project repository.

Search Service Configuration (elasticsearch.yml)

The search service uses an Elasticsearch server to handle search queries in your Liferay instance. Here is an example elasticsearch.yml file:

cluster:
  name: ${CLUSTER_NAME}

node:
  master: true
  name: ${HOSTNAME}
  data: true
  ingest: true

network.host: ${NETWORK_HOST}

path:
  data: /data/data
  logs: /data/log

bootstrap:
  memory_lock: ${MEMORY_LOCK}

xpack.security.enabled: ${ENABLE_XPACK_SECURITY}
xpack.monitoring.enabled: ${ENABLE_XPACK_MONITORING}

The elasticsearch.yml file belongs in the search/configs/[ENV]/config/ directory in your project repository.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy