Dockerfile:
FROM openresty/openresty:1.13.6.2-bionic
WORKDIR /usr/local/openresty/nginx/conf/
RUN apt update && \
apt install git wget mysql-server -y && \
git clone https://github.com/xsec-lab/x-waf.git && \
cp /usr/local/openresty/nginx/conf/x-waf/nginx_conf/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf && \
sed -i 's/user nginx;/#user nginx;/g' nginx.conf && \
sed -i '61 ilocation /sql {' nginx.conf && \
sed -i '62 iproxy_pass http://192.168.20.22:8980;' nginx.conf && \
sed -i '63 i}' nginx.conf && \
sed -i "s/writeurl.rule/whiteUrl.rule/g" /usr/local/openresty/nginx/conf/x-waf/waf.lua && \
wget https://github.com/xsec-lab/x-waf-admin/releases/download/x-waf-admin0.1/x-waf-admin0.1-linux-amd64.tar.gz && \
tar zxvf x-waf-admin0.1-linux-amd64.tar.gz && \
service mysql start && \
mysql -u root -p" " -Bse "create user 'waf-admin'@'localhost' identified by 'password';grant all privileges on *.* to 'waf-admin'@'localhost' with grant option;create database waf;" && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT /usr/local/openresty/bin/openresty && service mysql start && cd /usr/local/openresty/nginx/conf/x-waf-admin/ && ./server
run:
docker run -p80:80 -p5000:5000 mirchdocker/x-waf:latest
x-waf管理平台账号:admin/[email protected]
修改 nginx.conf proxy_pass 所需要代理的IP+port
Content type
Image
Digest
Size
257.1 MB
Last updated
over 6 years ago
docker pull mirchdocker/x-waf