特定のnginxブロックコード内のテキスト処理

特定のnginxブロックコード内のテキスト処理

スクリプトが実行されると、その中に残っている次のテキストブロックを変換する必要があります。その部分

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;
}

ベストアンサー1

おすすめ記事