# @mediporta/gatsby-plugin-nginx-redirect

> Adds your redirects to nginx conf on gatsby build

Latest version **0.0.14-preview.9** (published 2023-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mediporta/gatsby-plugin-nginx-redirect
pnpm add @mediporta/gatsby-plugin-nginx-redirect
yarn add @mediporta/gatsby-plugin-nginx-redirect
bun add @mediporta/gatsby-plugin-nginx-redirect
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14-preview.9 |
| Published | 2023-11-30 |
| First published | 2023-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18.0.0 |
| Dependencies | 2 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Floris Groenendijk |
| Maintainers | tripleemcoder |
| Keywords | gatsby, gatsby-plugin, nginx, redirect, redirects, nginx.conf, createRedirect |

## Links

- npm: https://www.npmjs.com/package/@mediporta/gatsby-plugin-nginx-redirect
- Repository: https://github.com/mediporta/gatsby-plugin-nginx-redirect
- Issues: https://github.com/mediporta/gatsby-plugin-nginx-redirect
- npm.io page: https://npm.io/package/@mediporta/gatsby-plugin-nginx-redirect

## Dependencies (2)

- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.0
- [nginx-conf](https://npm.io/package/nginx-conf.md) ^2.1.0

## Recent versions

- 0.0.14-preview.9 (latest) — 2023-11-30
- 0.0.14-preview.8 — 2023-11-30
- 0.0.14-preview.7 — 2023-11-23
- 0.0.14-preview.6 — 2023-11-23
- 0.0.14-preview.5 — 2023-11-23
- 0.0.14-preview.4 — 2023-11-23
- 0.0.14-preview.3 — 2023-11-23
- 0.0.14-preview.2 — 2023-11-23
- 0.0.14-preview.1 — 2023-11-23
- 0.0.14 — 2023-11-21
- 0.0.1 — 2023-11-20
- 1.0.0 — 2023-11-20

## README

## Description

This plugin creates a nginx conf file with the gatsby created redirects

### Dependencies

Gatsby version 4

In order to work you have to use the output .conf file in your nginx server

## How to install

`npm install --save @mediporta/gatsby-plugin-nginx-redirect`

## Available options

### inputConfigFile (required)

The path for input nginx configuration file

### outputConfigFile (required)

The path of the outputted nginx configuration file with the redirects within.

### whereToIncludeRedirects (optional)(defaults to: "server")

Dot notation to define where to include the redirects.
So "server" will search for the server header, "http.server" will search for http containing server.

## Examples of usage

### In gatsby-config.js

```javascript
plugins: [
  ...,
  {
    resolve: "@mediporta/gatsby-plugin-nginx-redirect",
    options: {
      inputConfigFile: `${__dirname}/nginx.conf`,
      outputConfigFile: `${__dirname}/nginx.out.conf`,
      whereToIncludeRedirects: "http.server" // defaults to: "server"
    },
  },
  ...
]
```

Now you can use gatsby\`s `createRedirect` action to generate your custom http redirects

## How to contribute

Feel free to open an issue with your doubt, bug or suggestion.

---
_Source: https://npm.io/package/@mediporta/gatsby-plugin-nginx-redirect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
