Skip to content

Instantly share code, notes, and snippets.

@ryochin
Last active February 5, 2023 22:27
Show Gist options
  • Save ryochin/20cead952ac88373e36f3df27e6f854b to your computer and use it in GitHub Desktop.
Save ryochin/20cead952ac88373e36f3df27e6f854b to your computer and use it in GitHub Desktop.
openresty with ngx_http_proxy_connect_module
FROM debian:stable-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential libssl-dev ca-certificates wget git \
libpcre3 libpcre3-dev zlib1g zlib1g-dev \
&& apt-get clean
WORKDIR /tmp
RUN git clone --depth=1 https://github.com/chobits/ngx_http_proxy_connect_module.git ngx_http_proxy_connect_module \
&& wget -q https://openresty.org/download/openresty-1.13.6.2.tar.gz \
&& tar xf openresty-1.13.6.2.tar.gz \
&& cd openresty-1.13.6.2/bundle/nginx-1.13.6 \
&& patch -p1 < ../../../ngx_http_proxy_connect_module/patch/proxy_connect_rewrite_1014.patch \
&& cd ../.. \
&& ./configure --prefix=/opt/openresty \
--without-http_ssi_module \
--without-http_userid_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_sub_module \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_gzip_static_module \
--with-http_gunzip_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-select_module \
--with-poll_module \
--with-file-aio \
--with-pcre-jit \
--add-module=../ngx_http_proxy_connect_module \
&& make install \
&& ln -sf /dev/stdout /opt/openresty/nginx/logs/access.log \
&& ln -sf /dev/stderr /opt/openresty/nginx/logs/error.log
COPY ./nginx.conf /opt/openresty/nginx/conf/
STOPSIGNAL SIGQUIT
ENV PATH="$PATH:/opt/openresty/luajit/bin:/opt/openresty/nginx/sbin:/opt/openresty/bin"
EXPOSE 80
CMD ["/opt/openresty/bin/openresty", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment