marfeel:test
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
marfeel:test [2020/03/16 12:28] – [Ami and UserData] dodger | marfeel:test [2020/03/16 15:32] – 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: | ||
- | | + | |
- | * id : '' | + | | **name** | '' |
+ | | **id** | '' | ||
\\ | \\ | ||
Line 62: | Line 63: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | Nginx proxy cache setup: | ||
+ | <file config | ||
+ | proxy_cache_path /dev/shm levels=1:2 keys_zone=marfeel: | ||
+ | proxy_cache | ||
+ | # | ||
+ | proxy_cache_key $scheme$proxy_host$request_uri; | ||
+ | proxy_cache_revalidate | ||
+ | </ | ||
+ | |||
+ | Default site: | ||
+ | <file config / | ||
+ | server { | ||
+ | listen 80 default_server; | ||
+ | listen [::]:80 default_server; | ||
+ | #root / | ||
+ | root / | ||
+ | index index.html index.htm ; | ||
+ | server_name _; | ||
+ | |||
+ | # compress all proxy requests | ||
+ | include conf.d/ | ||
+ | include conf.d/ | ||
+ | |||
+ | location ^~ /cgi-bin { | ||
+ | proxy_pass http:// | ||
+ | proxy_set_header Host $http_host; | ||
+ | proxy_cache_valid any 1m; | ||
+ | expires 10m; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Proxy compression config: | ||
+ | <file config / | ||
+ | # 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/ | ||
+ | gzip_types *; | ||
+ | </ | ||
+ | |||
+ | Static files '' | ||
+ | <file config / | ||
+ | # serve static files directly | ||
+ | # The ?: prefix is a ' | ||
+ | # the pattern to be captured into $1 which should help improve performance | ||
+ | location ~* ^.+\.(?: | ||
+ | # | ||
+ | expires | ||
+ | } | ||
+ | </ | ||
+ | |||
==== Python http server ==== | ==== Python http server ==== | ||
Line 95: | Line 152: | ||
===== Security group ===== | ===== Security group ===== | ||
- | I create | + | I create |
- | * name: '' | + | | **name** | '' |
===== auto-scaling Group ===== | ===== auto-scaling Group ===== | ||
- | | + | | **name** | '' |
Line 121: | Line 178: | ||
Code: | Code: | ||
- | <file bash make_it_cool.sh> | + | <file bash / |
#!/bin/bash | #!/bin/bash | ||
Line 302: | Line 359: | ||
\\ | \\ | ||
Config file: | Config file: | ||
- | <file config make_it_cool.config> | + | <file config |
# Our template for re-generate the config | # Our template for re-generate the config | ||
Line 327: | Line 384: | ||
*/3 * * * * | */3 * * * * | ||
</ | </ | ||
+ | |||
+ | |||
+ | ====== Things I forgot ====== | ||
+ | |||
+ | * Purge log files from '' | ||
+ | |||