proxy_pass in post_action location does not send any http request

jacks nginx-forum at forum.nginx.org
Tue Dec 3 09:48:23 UTC 2019


Hi

I am trying to configure NGINX to send another http request after successful
completion of the original proxied request, in order to count statistics
etc'
I am using post_action with proxy_pass as following:

 location / {
        proxy_http_version 1.1;
        proxy_set_header HOST $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port 1061;
        proxy_set_header X-Forwarded-Host $host:1061;
        proxy_set_header X-Forwarded-Server $host:1061;
        proxy_read_timeout 86400;
        proxy_max_temp_file_size 0;
        proxy_set_header Connection "";

        set $backend rack-storage-radosgw:8802;

        proxy_pass http://$backend;
    
        post_action /send_event;
  }

  location /send_event {
        proxy_method POST;
        set $s3_proxy_request
s3-proxy-manager:8946/internal/api/v3/s3proxies/actions/raise_event;
        proxy_pass http://$s3_proxy_request;
   }


   The request in location / is sent to rack-storage-radosgw.service.strato
and is completed successfully, but the request to s3-proxy-manager is not
sent at all. I used tcpdump to capture any traffic on port 8946 and no
traffic arrived. I also checked that send_event location is entered by code,
and it does ( using rewrite_by_lua_block).
    What am i doing wrong?
    Thanks

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,286384,286384#msg-286384



More information about the nginx mailing list