Skip to content

Instantly share code, notes, and snippets.

@maszd
maszd / gist:4e0e86ef78e576fc342f229d7bd7f497
Created April 2, 2017 08:56 — forked from moneytoo/gist:ab3f34e4fddc2110675952f8280f49c5
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7, also available from https://brouken.com/brouken-centos-7-repo/
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel rpmdevtools
OPENSSL="openssl-1.0.2k"
NGINX_VERSION="1.11.12-1"
NJS_VERSION="1.11.12.0.1.9-1"
rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-$NGINX_VERSION.el7.ngx.src.rpm
rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-module-geoip-$NGINX_VERSION.el7.ngx.src.rpm
rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-module-image-filter-$NGINX_VERSION.el7.ngx.src.rpm
@maszd
maszd / Nginx_1.11_Mainline_Cent_6_7_Static_OpenSSL_1.1.sh
Created April 2, 2017 10:48 — forked from kennwhite/Nginx_1.11_Mainline_Cent_6_7_Static_OpenSSL_1.1.sh
RPM build Nginx 1.11.x with ALPN on CentOS 6/7 using static OpenSSL 1.1 (v 1.02+ required for http/2 support in Chrome)
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7
CENTVER="6"
OPENSSL="openssl-1.1.0-pre5"
NGINX="nginx-1.11.0-1"
yum clean all
# Install epel packages (required for GeoIP-devel)
@maszd
maszd / compile-nginx.sh
Created April 3, 2017 13:16 — forked from sergeifilippov/compile-nginx.sh
Compile nginx from source with latest openssl, without-mail, modules: pagespeed, echo
# Install dependencies
#
# Setup adjustable vars
NGX_MODULE_PATH=$HOME/source
NGX_VERSION=1.10.2
OPENSSL_VERSION=1.0.2j
NGX_MODULE_ECHO=0.60
NGX_MODULE_CACHEPURGE=2.3
NGX_MODULE_HEALTHCHECK=0.3.0
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@maszd
maszd / Nginx 1.11.6 OpenSSL 1.1 Centos 7
Created April 3, 2017 13:36 — forked from justinobb/Nginx 1.11.6 OpenSSL 1.1 Centos 7
Nginx 1.11.6 OpenSSL 1.1 Centos 7
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7
CENTVER="7"
OPENSSL="openssl-1.1.0c"
NGINX="nginx-1.11.6-1"
yum clean all
# Install epel packages (required for GeoIP-devel)
@maszd
maszd / nginx.conf
Created April 6, 2017 11:20 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@maszd
maszd / pecl-memcached.sh
Created September 30, 2017 12:22 — forked from paul91/pecl-memcached.sh
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
@maszd
maszd / NginxRedirect.md
Created September 30, 2017 12:22 — forked from esfand/NginxRedirect.md
Nginx Redirect

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.