7

Configure nginx in Jelastic

 3 years ago
source link: https://marco.dev/nginx-jelastic
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Activate nginx compression in Jelastic

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

nginx_1.jpg
nginx_2.jpg

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

Author

Marco Molteni

Marco Molteni Blog


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK