Skip to content

Instantly share code, notes, and snippets.

server {
listen 80 default_server;
listen [::]:80 default_server;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
@ansulev
ansulev / perfect-ssl-labs-score.txt
Last active October 15, 2019 10:19
Getting a Perfect SSL Labs Score
# openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
# vim /etc/nginx/nginx.conf
...
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
ssl_stapling on;
ssl_stapling_verify on;
@ansulev
ansulev / install-lemp-arch-linux.txt
Created April 30, 2017 14:09
How to Install (LEMP) NginX, MySQL, PHP stack on Arch Linux
# How to Install (LEMP) NginX, MySQL, PHP stack on Arch Linux
@ansulev
ansulev / nginx-microcaching.txt
Last active February 26, 2020 01:26
Micro caching for Nginx
TODO: Compare with: https://www.howtoforge.com/why-you-should-always-use-nginx-with-microcaching
mkdir /usr/share/nginx/cache
#mkdir /var/run/nginx/cache
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_cache microcache;
fastcgi_cache_key $scheme$host$request_uri$request_method;
fastcgi_cache_valid 200 301 302 30s;
@ansulev
ansulev / gist:ee2b7215a9dc9c526a8bb061d4b9c408
Created May 16, 2017 03:02 — forked from fennb/gist:1283573
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
@ansulev
ansulev / inst-lemp-hhvm-aws-gcp-xenial.sh
Last active August 2, 2018 07:17
Install LEMP + HHVM on AWS and GCP with Ubuntu 16.04 (Xenial)
# update system
apt update -y && apt upgrade -y && apt autoremove -y && apt autoclean
# reboot
reboot
# remove dash
dpkg-reconfigure dash
# stop and disable sendmail if enabled
@ansulev
ansulev / ssl.conf
Created June 6, 2017 22:00
SSL settings for Nginx
server {
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
server_name server_IP_address;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
@ansulev
ansulev / wordpress-pinglist.txt
Last active July 10, 2018 08:15
WordPress ping list update - June 2017
http://bing.com/webmaster/ping.aspx
http://ping.blo.gs/
http://blog.goo.ne.jp/XMLRPC
http://blog.with2.net/ping.php
http://blogping.unidatum.com/RPC2
http://blogpingr.de/ping/rpc2
https://ping.blogs.yandex.ru/RPC2
http://blogsearch.google.co.cr/ping/RPC2
http://blogsearch.google.co.hu/ping/RPC2
http://api.moreover.com/ping
@ansulev
ansulev / php-memcached-test.php
Last active November 11, 2020 13:38
PHP Memcached Server Test
<?php
// Test default memcached server. Load, then refresh.
if (class_exists('Memcache')) {
$meminstance = new Memcache();
} else {
$meminstance = new Memcached();
}
$meminstance->addServer("127.0.0.1",11211);
@ansulev
ansulev / wps-pins.dict
Last active January 16, 2024 22:46
WPS Audit Pins Dictionaries
https://www.wifi-libre.com/topic-626-base-de-datos-wpspin-original-open-source-actualizada-page-4.html
http://www.downloadwireless.net/scripts-live/patrones_conocidos.txt
100 Pins:
https://drive.google.com/open?id=0BzKLb-Q5X_sbSmN0UXZrWnRFREE
500 Pins:
https://drive.google.com/open?id=0BzKLb-Q5X_sbdVhkSEEyRkU1azQ
1000 Pins: