Skip to content

Use relative paths in directory listing? #661

@ahayes

Description

@ahayes

Steps to reproduce the issue, if applicable. Include the actual command and output and/or stack trace.

Thanks for http-server.

When serving a folder of files/paths using http-server, while it is being reverse-proxied by NGINX or Apache, the hard-coding of absolute paths (leading "/") in hrefs makes life difficult.

What did you expect to happen?

I would expect relative URL paths to the files/folders in the dynamic index output.

If the issue is a feature request, what is the motivation / use case for it?

Using Apache or NGINX to proxy is very common. The configuration is relatively simple if the application being proxied does not make assumptions about where it resides. When applications return URLs with leading slashes, the proxy configuration gets much more complicated, error prone, and expensive.

Tell us about your environment

  • exact http-server version:
    0.12.3
  • Node version:
    v8.17.0
  • Platform:
    smartos
    Other information (related issues, suggestions for a fix, etc):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions