Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@digicat/canonical-redirector

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digicat/canonical-redirector

Redirects HTTP traffic to a configured canonical HTTPS host

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@digicat/canonical-redirector

Redirects HTTP traffic to a configured canonical HTTPS host.

This package is perfect for running in an ALB target group, receiving HTTP traffic, or even HTTPS traffic for a non-canonical host. It supports health checks at /healthcheck, requests to which receive a 200 OK response instead of a redirect. No requests are logged, errors are not reported. Configuration is done through two environment variables:

  • CANONICAL_HOSTNAME: The host to redirect to.
  • PORT: The port to listen on. Defaults to 4000.

Note that .env files are not resolved.

Usage

$ CANONICAL_HOSTNAME=www.digitalcatapultcentre.org.uk PORT=4000 npm start

Then:

$ curl -v -H 'host: digitalcatapultcentre.org.uk' localhost:4000/
> GET / HTTP/1.1
> host: digitalcatapultcentre.org.uk
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< location: https://www.digitalcatapultcentre.org.uk/
< Date: Tue, 17 Oct 2017 15:28:54 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<

Keywords

FAQs

Package last updated on 17 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc