Skip to content

Instantly share code, notes, and snippets.

View Yinchie's full-sized avatar
♥️

Yee Chie Yinchie

♥️
View GitHub Profile
Verifying that +yeechie is my blockchain ID. https://onename.com/yeechie

Keybase proof

I hereby claim:

  • I am yinchie on github.
  • I am yeechie (https://keybase.io/yeechie) on keybase.
  • I have a public key whose fingerprint is 49C3 0DF3 6393 CD95 E93F A457 16CF E267 6760 8DB6

To claim this, I am signing this object:

@Yinchie
Yinchie / proxy.conf
Last active January 6, 2017 22:43
Nginx proxy config for each location /
proxy_hide_header Server;
proxy_hide_header X-Powered-By;
proxy_hide_header Etag;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@Yinchie
Yinchie / tls.conf
Last active February 17, 2017 22:50
My Ghost blog, NGiNX TLS configuration | X25519 & secp384r1 | RSA & ECDSA
# RSA certificate
ssl_certificate /path/rsa_fullchain.pem;
ssl_certificate_key /path/rsa-2048.key;
# ECDSA certificate
ssl_certificate /path/ec_fullchain.pem;
ssl_certificate_key /path/ec-secp384r1.key;
# DH (Diffie–Hellman)
ssl_dhparam /path/dhparam4096.pem;
@Yinchie
Yinchie / serverbench.log
Created December 11, 2016 12:04
Vultr Cloud Compute (VC2) | 15GB SSD 1 CPU 768MB RAM | VPS Benchmark using serverbench.
----------------------------------------------------------------------
CPU model : Virtual CPU 714389bda930
Number of cores : 1
CPU frequency : 2399.996 MHz
Total amount of ram : 740 MB
Total amount of swap : 1023 MB
System uptime : 3days, 0:10:45
Load average : 0.03, 0.04, 0.00
OS : Ubuntu 16.04.1 LTS
Arch : x86_64 (64 Bit)
@Yinchie
Yinchie / proxy_pagespeed.conf
Last active December 31, 2016 11:25
My Ghost blog, NGiNX pagespeed config for specific "location"'s.
pagespeed RewriteLevel PassThrough;
pagespeed PreserveUrlRelativity on;
pagespeed NoTransformOptimizedImages on;
pagespeed EnableFilters rewrite_images,recompress_images,insert_image_dimensions;
pagespeed EnableFilters remove_comments,collapse_whitespace,extend_cache,convert_meta_tags;
pagespeed EnableFilters remove_quotes,insert_dns_prefetch;
pagespeed EnableFilters rewrite_css,fallback_rewrite_css_urls,rewrite_style_attributes,inline_css;
pagespeed EnableFilters rewrite_javascript;
@Yinchie
Yinchie / pagespeed.conf
Last active December 30, 2016 13:09
My Ghost blog, general NGiNX pagespeed config.
pagespeed on;
pagespeed FileCachePath /var/cache/nginx/pagespeed;
pagespeed FileCacheSizeKb 102400;
pagespeed FileCacheCleanIntervalMs 3600000;
pagespeed FileCacheInodeLimit 500000;
pagespeed XHeaderValue "optimized";
pagespeed EnableCachePurge on;
pagespeed ForceCaching on;
pagespeed MessageBufferSize 100000;
@Yinchie
Yinchie / security_headers.conf
Last active February 17, 2017 22:51
Only applying this config to the main website "location" and not on static assets. Saves bandwidth, since the headers only have an impact during the website load.
add_header X-UA-Compatible "IE=Edge";
# Enable reflective cross-site-scripting protection filter in browsers.
add_header X-XSS-Protection "1; mode=block";
# Strengthens the implementation of TLS by getting the User Agent to enforce the use of HTTPS.
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
# Tell the browser whether you want to allow your site to be framed or not.
# By preventing a browser from framing your site you can defend against attacks like clickjacking.
@Yinchie
Yinchie / build-nginx.sh
Last active November 3, 2021 10:55 — forked from Belphemur/build_nginx.sh
Compiling NGiNX with OpenSSL TLS1.3, Brotli, more_headers, NAXSI - Ubuntu 20.04.1 x64
#!/usr/bin/env bash
# Run as root or with sudo
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root or with sudo."
exit 1
fi
# Make script exit if a simple command fails and
# Make script print commands being executed
set -e -x
@Yinchie
Yinchie / security_cors.conf
Created December 31, 2016 11:26
My Ghost blog, NGiNX CORS config.
if ($request_method = "OPTIONS") {
more_set_headers "Access-Control-Allow-Origin: www.itchy.nl";
more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS";
more_set_headers "Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type";
more_set_headers "Access-Control-Max-Age: 1728000";
more_set_headers "Content-Type: text/plain charset=UTF-8";
more_set_headers "Content-Length: 0";
return 204;
}