GithubHelp home page GithubHelp logo

idvb / middy-reroute Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 4.0 2.08 MB

middy-reroute is a MiddyJS middleware (AWS Lambda) providing complex redirect, rewrite and proxying capabilities by placing a rules file into your S3 bucket.

Home Page: https://reroute.danvanbrunt.com

License: MIT License

JavaScript 99.42% HTML 0.50% DIGITAL Command Language 0.08%
aws cloudfront javascript lambda lambdaatedge middleware middy proxy redirects rewrites s3

middy-reroute's People

Contributors

dependabot[bot] avatar henrik-hey avatar idvb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

middy-reroute's Issues

Passing Headers from Request to Response

The only header getting passed is the location header - there are multiple headers, including custom headers, whitelisted on the Cloudfront.

What values need to be added to the options block in order to pass on either specific headers or even all headers.

Workaround for ":" Query Strings

I'm implementing a new redirect solution for one of our many horrible systems. Unfortunately, one of our regions is still using ":" in it's html queries.

Example:
/footwear/ to http://www.website.com/local/search?text=Shoe&q=Shoe:relevance:gender:MALE

Is there anyway to escape those ":" characters in the _redirects file so they don't get automatically interpolated as undefined?

Adding Support for HTTP access to _redirect files

We're utilizing middy and middy-reroute for a redirector internally and so far it's working great. We went over the architecture with our AWS TAM and they recommended that instead of referencing an item in an S3 bucket directly, to reference a Cloudfront instead because it would be able to cache the S3 files, greatly speeding up the object access.

We're running into what we believe to be a few false positives from Pingdom, but, just in case, I want to pull together a prototype of that implementation to see if it makes a difference in response time.

Have you explored this method already? I would love to know your thoughts!

rule file path is always prefixed with "origin prefix" in 2.5.4

Upgrading from 2.4.1, I noticed all the reroute rules defined in the rule file stopped working.

S3 access log shows the rule file path from Middy Reroute is now prefixed with any prefix defined in the origin.
Here is an example:
const opts={
file: '_redirects/rule1",
rulesBucket: "bucket1"
}

origin is defined as "bucket1/sites"

In 2.4.1, the rule path used is "bucket1/_redirects/rule1"
in 2.5.4, the rule path used is "bucket1/sites/_redirects/rule1"

Is this a bug? The documentation seems to suggest the optional "rulesBucket" and "file" options should form the complete s3 path regardless how the origin is defined.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.