Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static files/directory config for appsettings.json #904

Closed
xXBuilderBXx opened this issue Apr 9, 2021 · 3 comments
Closed

Static files/directory config for appsettings.json #904

xXBuilderBXx opened this issue Apr 9, 2021 · 3 comments
Labels
Type: Idea This issue is a high-level idea for discussion.

Comments

@xXBuilderBXx
Copy link

Add support for configuring static files/directories with appsettings.json just like how nginx allows it.

The key can be default Address or it could be named Path to seperate it.
Nginx also allows to specify an index file like index index.html; this could also be used as another value "Index": "index.html"

"ReverseProxy": {
    "Routes": [
      {
        "RouteId": "route1",
        "ClusterId": "cluster1",
        "Match": {
          "Path": "{**catch-all}"
        }
      }
    ],
    "Clusters": {
      "cluster1": {
        "Destinations": {
          "cluster1/destination1": {
            "Address": "/linux/path/here/"
          }
        }
      }
    }
  }
@xXBuilderBXx xXBuilderBXx added the Type: Idea This issue is a high-level idea for discussion. label Apr 9, 2021
@Tratcher
Copy link
Member

Tratcher commented Apr 9, 2021

Duplicate of #187

This is tangential to YARP's primarily concern as a library for routing to external sources. We do consider static file config important in the pre-built exe scenario that would be comparable to nginx.

I don't envision this as being part of the cluster config, none of the cluster settings make sense for static assets. I expect it would use a different config section entirely.

@samsp-msft
Copy link
Member

samsp-msft commented Apr 9, 2021

What is missing here (possibly more from ASP.NET than YARP) is a standard config section for configuring static files. In the same way that you add the config provider to YARP, it would nice to be able to specify a config section that would map to a StaticFileOptions instance enabling the configuration of folders, headers, auth, content types etc from config rather than code.

Not that difficult to write, but probably not a high priority for YARP v1.

@karelz
Copy link
Member

karelz commented Apr 22, 2021

Duplicate of #187

@karelz karelz marked this as a duplicate of #187 Apr 22, 2021
@karelz karelz closed this as completed Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Idea This issue is a high-level idea for discussion.
Projects
None yet
Development

No branches or pull requests

4 participants