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

next-ssl-redirect-middleware

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-ssl-redirect-middleware

Nextjs Middleware to redirect http to https

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
513
decreased by-43.06%
Maintainers
1
Weekly downloads
 
Created
Source

next-ssl-redirect-middleware

Nextjs Middleware to redirect http to https. This is helpful if you are hosting your site on a service that doesn't have "force ssl" support out of the box (IE: heroku).

Install

npm i -S next-ssl-redirect-middleware

Usage

Create a file middleware.ts (or .js) with the following:

import sslRedirect from 'next-ssl-redirect-middleware';

export default sslRedirect({});

Options:

  • environments: List of NODE_ENV to run this middleware for. Defaults ['production']

  • status: The status code to redirect with. defaults to 301

Credits

paulomcnally/node-heroku-ssl-redirect was referenced heavily in the creation of this library.

Keywords

FAQs

Package last updated on 28 Aug 2023

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