User Tools

Site Tools


marfeel:test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
marfeel:test [2020/03/16 12:28] – [Ami and UserData] dodgermarfeel:test [2020/03/17 07:58] – [Things I forgot] dodger
Line 16: Line 16:
 ===== Ami and UserData ===== ===== Ami and UserData =====
 I did some mistakes, so I create some versions of it: I did some mistakes, so I create some versions of it:
-  * name ''dodger_marfeel_test_003'' + 
-  * id ''ami-0bc1be25784321fc1''+| **name** | ''dodger_marfeel_test_003''  
 +| **id** | ''ami-0bc1be25784321fc1'' |
  
 \\ \\
Line 62: Line 63:
 } }
 </file> </file>
 +
 +Nginx proxy cache setup:
 +<file config  /etc/nginx/conf.d/proxy_cache.conf>
 +proxy_cache_path /dev/shm levels=1:2 keys_zone=marfeel:1m;
 +proxy_cache                     marfeel;
 +#proxy_cache_background_update  on;
 +proxy_cache_key $scheme$proxy_host$request_uri;
 +proxy_cache_revalidate          on;
 +</file>
 +
 +Default site:
 +<file config /etc/nginx/sites-available/default.conf>
 +server {
 +        listen 80 default_server;
 +        listen [::]:80 default_server;
 +        #root /opt/test/www;
 +        root /opt/test/Marfeel-appserverpythontestapp-2937d4f8673c;
 +        index index.html index.htm ;
 +        server_name _;
 +
 +        # compress all proxy requests
 +        include conf.d/proxy_compression.conf;
 +        include conf.d/static_files.conf;
 +
 +        location ^~ /cgi-bin {
 +                proxy_pass http://localhost:8080;
 +                proxy_set_header Host $http_host;
 +                proxy_cache_valid any      1m;
 +                expires 10m;
 +        }
 +}
 +</file>
 +
 +Proxy compression config:
 +<file config /etc/nginx/conf.d/proxy_compression.conf>
 +# Enable gzip but do not remove ETag headers
 +gzip on;
 +gzip_vary on;
 +gzip_comp_level 4;
 +gzip_min_length 256;
 +gzip_proxied any;
 +#gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
 +gzip_types *;
 +</file>
 +
 +Static files ''expires'':
 +<file config /etc/nginx/conf.d/static_files.conf>
 +# serve static files directly
 +# The ?: prefix is a 'non-capturing' mark, meaning we do not require
 +# the pattern to be captured into $1 which should help improve performance
 +location ~* ^.+\.(?:jpg|jpeg|gif|css|png|js|ico|txt)$ {
 +    #access_log        off;
 +    expires           1h;
 +}
 +</file>
 +
  
 ==== Python http server ==== ==== Python http server ====
Line 95: Line 152:
  
 ===== Security group ===== ===== Security group =====
-I create the 001 group with https, then I remove it in the 2nd version: +I create a security group (ending with 001) with https, then I remove it in the 2nd version: 
-  * name''dodger_launch_002''+| **name** | ''dodger_launch_002'' |
  
 ===== auto-scaling Group ===== ===== auto-scaling Group =====
  
-    * name''marfeel_scalinggroup_001''+| **name** | ''marfeel_scalinggroup_001'' |
  
  
Line 121: Line 178:
  
 Code: Code:
-<file bash make_it_cool.sh>+<file bash /root/marfeel_auto_updater/make_it_cool.sh>
 #!/bin/bash #!/bin/bash
  
Line 302: Line 359:
 \\ \\
 Config file: Config file:
-<file config make_it_cool.config>+<file config /root/marfeel_auto_updater/make_it_cool.config>
  
 # Our template for re-generate the config # Our template for re-generate the config
Line 327: Line 384:
 */3 *   * * *   root    /root/marfeel_auto_updater/make_it_cool.sh */3 *   * * *   root    /root/marfeel_auto_updater/make_it_cool.sh
 </code> </code>
 +
 +
 +====== Things I forgot ======
 +
 +  * Purge log files from ''make_it_cool.sh'' in HA proxy node
 +  * A lot of additional checks for the script...