@mediporta/gatsby-plugin-nginx-redirect
Version:
Adds your redirects to nginx conf on gatsby build
54 lines (34 loc) • 1.24 kB
Markdown
This plugin creates a nginx conf file with the gatsby created redirects
Gatsby version 4
In order to work you have to use the output .conf file in your nginx server
`npm install --save @mediporta/gatsby-plugin-nginx-redirect`
The path for input nginx configuration file
The path of the outputted nginx configuration file with the redirects within.
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.
```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
Feel free to open an issue with your doubt, bug or suggestion.