Skip to content

Use of HTTP_HOST prevents path proxying against Docker container #2607

@pcolmer

Description

@pcolmer

Describe the bug
yours_get_request uses HTTP_HOST to divine the full URL of the shortlink request but, if yourls is running in a Docker container and it is being proxied from a non-root path, that logic is faulty.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a yourls Docker container with YOURLS_SITE set to the "external" FQDN URL including the "/app" path (see step 2).
  2. Configure Apache to proxy "/app" to the underlying YOURLS instance.
  3. Try to retrieve a short link.

Expected behavior
The underlying full link associated with the short link is returned.

Actual behavior
YOURLS fails to return the link because the use of the Apache variables causes the path to be left in the request field, thereby failing to match the shortlink.

Versions
1.7.6 in a Docker container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions