Score:0

Nginx $args are being cleared before assigned

jp flag

The proxy request is being made:

location /tracking-ga4 {    
        proxy_method POST;
        proxy_set_header content-type "application/json";
        proxy_set_body '{ "client_id": "$arg_client_id", "user_id": "$arg_user_id", "non_personalized_ads": $google_pixel_non_personalized_ads, "events": [{ "name": "$google_pixel_name", "params": { "name_of_letter": "$arg_name_of_letter" } }] }';

        set $args '';

        proxy_pass https://www.google-analytics.com/mp/collect?&measurement_id=$google_pixel_measurement_id&api_secret=$google_pixel_api_secret;
    }

The problem is that if I use set $args ''; the GET args that came with request are being cleared and nothing gets to $arg_XXXXX variables, if I don't use set $args ''; than args are being concatinated to proxy URL and I get something like https://www.google-analytics.com/mp/collect?&measurement_id=XXX&api_secret=XXXX?client_id=XXXX... ?client_id=XXXX gets into api_secret=. The second question is it fine to use variables in proxy_pass URL like this

?&measurement_id=$google_pixel_measurement_id&api_secret=$google_pixel_api_secret

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.