SonarQube反向代理配置

时间:2016-12-23 12:11:15

标签: sonarqube sonarqube-ops

我无法通过反向代理获得https工作。从https到http似乎提供了困难。以下是配置。

    ProxyPass               /sonar2 http://server:8998
    ProxyPassReverse        /sonar2 http://server:8998/sonar2

   <Proxy http://server:8998/*>
      Order deny,allow
      Allow from all
      ErrorDocument 503 /error/sonar/503/index.html
    </Proxy>
    <Location /sonar>
      ErrorDocument 503 /error/sonar/503/index.html
    </Location>

1 个答案:

答案 0 :(得分:2)

首先,您的代理配置似乎不正确,您应该:

function wc_ninja_product_is_in_the_cart() {
/*array 1*/
$array1_ids = array( '1', '3', '5');//field that should
/*array 2*/
//$micro_ids = array( '2', '4');//fields that shouldnt come back

    // Products currently in the cart
    $cart_ids = array();
    $cart_categories = array();

    // Find each product in the cart and add it to the $cart_ids array
    foreach( WC()->cart->get_cart() as $cart_item_key => $values ) {
        $cart_product = $values['data'];
        $cart_ids[]   = $cart_product->id;
    }

    // If one of the special products are in the cart, return true.
    if ( ! array_intersect($array1_ids, $cart_ids) ) {
        echo "true: " , implode(';',$cart_ids);;//bug fixing
        return true;
    } else {
        return false;
        echo "false: " , implode(';',$cart_ids);;//bug fixing
    }
}
//Field Remover
function wc_ninja_remove_checkout_field( $fields ) {
    if ( ! wc_ninja_product_is_in_the_cart() )    {
        //removes Field x_name
        unset( $fields['billing']['x_name'] );
    }
    return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'wc_ninja_remove_checkout_field' ); 

为了进一步帮助您,您能描述一下您的错误吗?

您是否将SonarQube的上下文配置为/ sonar2? SonarQube是否配置为侦听8998端口?