Skip to content

Proxy header override issue #86

@zarkerus

Description

@zarkerus

When I added stac-auth-proxy between my reverse proxy (nginx) and stac-fastapi-pgstac, all of my links changed to http instead of https

"links": [
{
"rel": "self",
"type": "application/json",
"title": "This document",
"href": "http://stac-api.example.com/"
},

proxy_proto = request.url.scheme

I don't know much about python but I think this line of code is override the header X-Forwarded-Proto coming to stac-auth-proxy
request.url.scheme comes from the request that arrived at stac-auth-proxy (Which is TLS terminated), not what Nginx passed

Possible fix
proxy_proto = request.headers.get("X-Forwarded-Proto", request.url.scheme)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions