Skip to content

Instantly share code, notes, and snippets.

@cihangir
Last active August 29, 2015 14:24
Show Gist options
  • Save cihangir/f4acfe87fe49c9356019 to your computer and use it in GitHub Desktop.
Save cihangir/f4acfe87fe49c9356019 to your computer and use it in GitHub Desktop.
Compile Ngnix from source with TCP Proxy Module enabled
nginxVersion="1.9.2"
wget http://nginx.org/download/nginx-$nginxVersion.tar.gz
tar -xzf nginx-$nginxVersion.tar.gz
ln -sf nginx-$nginxVersion nginx
cd nginx
git clone [email protected]:yaoweibin/nginx_tcp_proxy_module.git
patch -p1 < ./nginx_tcp_proxy_module/tcp.patch
mkdir -p /etc/nginx/logs
./configure \
--prefix=/usr/share/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body \
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi \
--http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi \
--http-scgi-temp-path=/var/lib/nginx/tmp/scgi \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/subsys/nginx \
--user=nginx \
--group=nginx \
--with-file-aio \
--with-ipv6 \
--with-http_ssl_module \
--with-http_spdy_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-mail \
--with-mail_ssl_module \
--with-pcre \
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' \
--with-ld-opt=' -Wl,-E' \
--add-module=./nginx_tcp_proxy_module
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment