• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    JavaScript
  • License
    BSD 2-Clause "Sim...
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

next-nginx-routes

Generate Nginx routes configuration file for Next.js static HMTL export.

This NPM package allows you to convert Next.js routes like:

{
  "page": "/[foo]",
  "regex": "^/([^/]+?)(?:/)?$",
  "routeKeys": { "foo": "foo" },
  "namedRegex": "^/(?<foo>[^/]+?)(?:/)?$"
}

... into Nginx routes like:

location ~ ^/([^/]+?)(?:/)?$ {
  try_files /[foo].html /index.html;
}

Getting started

Installation

yarn add --dev next-nginx-routes

Generate Nginx configuration file

Add next-nginx-routes to your export script:

{
  "export": "next build && next export && next-nginx-routes"
}

And run Next.js export:

yarn run export

Include Nginx configuration file

Finally include the generated configuration file next-routes.conf and the Next.js output in your Nginx site configuration file.

Requirements

More

  • See example folder for a minimal Docker example.
  • Read more about this approach in our blog post.

More Repositories

1

openlayers-editor

OpenLayers Editor
JavaScript
215
star
2

ole

OpenLayers Editor
JavaScript
147
star
3

react-spatial

Components to build React map apps
JavaScript
48
star
4

gtfsparser

A GTFS parsing library for Go
Go
42
star
5

gtfsman

Repository-like tool to manage and update a huge number of GTFS feeds
Python
20
star
6

trafimage-maps

Code of the Trafimage web map portal and other applications built on it.
JavaScript
14
star
7

redis-websocket-api

Provides an extensible Redis-over-WebSocket API on top of websocket and aioredis
Python
12
star
8

mobility-toolbox-js

TypeScript
10
star
9

trafimage-geoserver-transformations

Geoserver rendering transformation for feature aggregation for the visualization of train networks in the context of the swiss SBB Trafimage project.
Java
8
star
10

geoserver-sec-drupal

Binds GeoServer to Drupal so that multiple Drupal instance can provide user and roles for GeoServer
Java
8
star
11

react-transit

This library provides React components to visualize real-time geographical information based on OpenLayers.
JavaScript
7
star
12

drupal-geo

Geo module for Drupal
PHP
6
star
13

mdb-pgsql

Convert Microsoft Access 2000 databases to PostgreSQL SQL files
Shell
6
star
14

tree-app

PWA for tree recommendations
JavaScript
5
star
15

cartaro-docker

Dockerfile for Cartaro Docker container
Shell
5
star
16

vdv2pg

Tool for dumping VDV 451 data into a postgres database
Python
4
star
17

tree-lib

Library for tree recommendations
TSQL
4
star
18

geoserver-documentor

Geoserver extension to provide a REST interface (XML) for automated documentation of layers and their data sources
Java
3
star
19

ole-demo

OpenLayers Editor demo
PHP
2
star
20

react-spatial-starter

JavaScript
2
star
21

python-gitoliteparser

Simple parser for gitolites repository configuration files
Python
2
star
22

pgwrench

a comandline tool for postgresql admin tasks
Python
2
star
23

pg_routejoin

automatically build SQL to join tables based on foreign key constraints
Python
2
star
24

pygtfslib

Python
2
star
25

trafimage-planeditor

Website trafimage.mapset.ch based on Netlify CMS
JavaScript
2
star
26

pysnapping

Python
1
star
27

bodo

Web application to manage data about geological drill holes
PHP
1
star
28

phpunit-utils

helper tools for phpunit
Python
1
star
29

ole-mapfish

MapFish implementation for OpenLayers Editor
JavaScript
1
star
30

fabric_debian

debian specific fabric commands
Python
1
star