OP快捷运维系统安装nginx代理

OP快捷运维系统安装nginx代理

建议使用openresty,支持nginx lua支持waf脚本,waf脚本可以参考 https://github.com/opcache/wp-docker/tree/master/waf

新建nginx配置目录

mkdir -p /opt/nginx/conf.d
mkdir -p /data/nginx-log
cd /opt/nginx/conf.d

编辑nginx配置

vi www.test.com.conf
写入以下配置
server {
                server_name -;
                listen 80 default;
                index index.php index.html index.htm;
    charset utf-8;


    location / {
     proxy_set_header  X-Forwarded-For $remote_addr;
     proxy_set_header  X-Forwarded-Host $server_name;
     proxy_set_header            X-real-ip $remote_addr;
     proxy_set_header Host $host;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_pass http://127.0.0.1:8080;
    }



                access_log  /data/nginx-log/www.test.com.access.log access;
                error_log   /data/nginx-log/www.test.com.error.log error;
        }

docker启动nginx

docker run -it -d  --name docker-nginx11 --net=host -v /data/nginx-log:/data/nginx-log -v /opt/nginx/conf.d:/etc/nginx/conf.d -v /data/wwwroot:/data/wwwroot opcache/danmp:waf-v1

即可访问