当脚本运行时,我需要转换保留在其中的以下文本块。那个部分
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass $scheme://$CPANEL_APACHE_PROXY_REQ_IP:$CPANEL_APACHE_PROXY_REQ_PORT;
可能会改变,所以我需要处理块内的任何内容
location / {
}
代码:
location / {
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass $scheme://$CPANEL_APACHE_PROXY_REQ_IP:$CPANEL_APACHE_PROXY_REQ_PORT;
}
进入
location / {
limit_req zone=foo burst=300 nodelay;
limit_conn addr 1;
limit_rate 200k;
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass $scheme://$CPANEL_APACHE_PROXY_REQ_IP:$CPANEL_APACHE_PROXY_REQ_PORT;
}
limit_req_status 429;
limit_conn_status 429;
error_page 429 /429.html;
location = /429.html {
root /usr/share/nginx/html;
internal;
}