Configure nginx in Jelastic


Activate nginx compression in Jelastic

Select the config icon in the Load Balancer service/node.

Open the file /etc/nginx/nginx-jelastic.conf.

Activate the compression gzip on;

Add the following types to the compression:

gzip_types 
      text/plain 
      text/css 
      text/html 
      text/javascript 
      application/javascript 
      application/x-javascript 
      application/xml 
      application/json 
      application/ld+json; 

Restart the nginx node;

Redirect all the HTTP requests to HTTPS

in nginx-jelastic.conf search for the following text:

#GFADMIN 
 
        server { 
                listen *:80; 
                listen [::]:80; 
                server_name  _; 

and add the line
return 301 https://$host$request_uri;

Restart the nginx nodes