Skip to content

Lost token after a 301 redirection #294

@dreamkiller52

Description

@dreamkiller52

Hi,
Not sure t's a influxdb-client bug but try here first.

When trying to push data into influxdb behind a nginx proxy I lost the Authentification token

Specifications:_

  • Client Version:1.19
  • InfluxDB Version:
  • Platform: docker ubuntu

send: b'POST /api/v2/write?org=my_org&bucket=ups&precision=ns HTTP/1.1\r\nHost: influxdb.mydomain.com\r\nAccept-Encoding: identity\r\nContent-Length: 657\r\nContent-Encoding: identity\r\nContent-Type: text/plain\r\nAccept: application/json\r\nAuthorization: Token OnT56TUQYifLi0d-z0HYxzBSBxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxjI-iKwXSw4yGcqfXAu5BOjOm46HH_ngc5Ty5g==\r\nUser-Agent: influxdb-client-python/1.19.0\r\n\r\n'

send: b'ups,hardware=P3:60:J4:0V:HB:,host=NAS,model=Ellipse\ PRO\ 1200,source=NUT battery.charge=100i,battery.runtime=2682i,input.frequency=50,input.voltage=237,input.voltage.extended="no",outlet.1.desc="PowerShare Outlet 1",outlet.1.id=2i,outlet.1.status="on",outlet.1.switchable="no",outlet.2.desc="PowerShare Outlet 2",outlet.2.id=3i,outlet.2.status="on",outlet.2.switchable="no",outlet.desc="Main Outlet",outlet.id=1i,outlet.switchable="no",output.frequency=50,output.frequency.nominal=50i,output.voltage=234,output.voltage.nominal=230i,ups.delay.start=30i,ups.load=11i,ups.power=119i,ups.power.nominal=1200i,ups.realpower=86i,ups.status="OL",ups.timer.start=0i'

reply: 'HTTP/1.1 301 Moved Permanently\r\n'

header: Server: nginx/1.20.1

header: Date: Wed, 28 Jul 2021 07:34:59 GMT

header: Content-Type: text/html

header: Content-Length: 169

header: Connection: keep-alive

header: Location: https://influxdb.mydomain.com/api/v2/write?org=myorg&bucket=ups&precision=ns

send: b'POST /api/v2/write?org=myorg&bucket=ups&precision=ns HTTP/1.1\r\nHost: influxdb.mydomain.com\r\nAccept-Encoding: identity\r\nContent-Length: 657\r\nContent-Encoding: identity\r\nContent-Type: text/plain\r\nAccept: application/json\r\nUser-Agent: influxdb-client-python/1.19.0\r\n\r\n'

send: b'ups,hardware=P3:60:J4:0V:HB:,host=NAS,model=Ellipse\ PRO\ 1200,source=NUT battery.charge=100i,battery.runtime=2682i,input.frequency=50,input.voltage=237,input.voltage.extended="no",outlet.1.desc="PowerShare Outlet 1",outlet.1.id=2i,outlet.1.status="on",outlet.1.switchable="no",outlet.2.desc="PowerShare Outlet 2",outlet.2.id=3i,outlet.2.status="on",outlet.2.switchable="no",outlet.desc="Main Outlet",outlet.id=1i,outlet.switchable="no",output.frequency=50,output.frequency.nominal=50i,output.voltage=234,output.voltage.nominal=230i,ups.delay.start=30i,ups.load=11i,ups.power=119i,ups.power.nominal=1200i,ups.realpower=86i,ups.status="OL",ups.timer.start=0i'

reply: 'HTTP/1.1 401 Unauthorized\r\n'

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions