https://github.com/clement-muth/nextjs-traefik
Enhance your Next.js app with Traefik integration—no Docker needed. This repo streamlines a personalized host setup like "nextjs.localhost" using a reverse proxy and load balancer. Achieve secure HTTPS access via TLS with mkcert. Simplify deployment, configure Traefik and Next.js settings effortlessly for optimal performance.
https://github.com/clement-muth/nextjs-traefik
https load-balancer mkcert nextjs reverse-proxy tls traefik without-docker
Last synced: 2 months ago
JSON representation
Enhance your Next.js app with Traefik integration—no Docker needed. This repo streamlines a personalized host setup like "nextjs.localhost" using a reverse proxy and load balancer. Achieve secure HTTPS access via TLS with mkcert. Simplify deployment, configure Traefik and Next.js settings effortlessly for optimal performance.
- Host: GitHub
- URL: https://github.com/clement-muth/nextjs-traefik
- Owner: Clement-Muth
- License: mit
- Created: 2023-12-09T09:48:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-09T10:12:03.000Z (over 1 year ago)
- Last Synced: 2024-12-27T17:35:27.753Z (4 months ago)
- Topics: https, load-balancer, mkcert, nextjs, reverse-proxy, tls, traefik, without-docker
- Language: TypeScript
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Traefik Integration with Next.js App
## Overview
This repository serves as a guide and configuration setup for integrating [Traefik](https://traefik.io/traefik/) with a Next.js application WITHOUT docker. The goal is to implement Traefik as a reverse proxy and load balancer, providing a customized host, such as "nextjs.localhost." Additionally, the setup includes TLS integration for secure HTTPS access, utilizing a certificate generated by [mkcert](https://github.com/FiloSottile/mkcert).
## Prerequisites
Before getting started, ensure you have the following prerequisites installed on your system:
- Traefik
- Mkcert## Getting Started
Follow these steps to integrate Traefik with your Next.js app:
1. Clone this repository:
```bash
git clone https://github.com/Clement-Muth/nextjs-traefik.git
```2. Navigate to the project directory:
```bash
cd nextjs-traefik
```3. Generate SSL certificates using mkcert:
```bash
mkcert -uninstall
sudo rm -rf /etc/ssl/certs/mkcert*
mkdir -p certs/root
mkcert -cert-file certs/cert.pem -key-file certs/key.pem "nextjs.localhost"
mkcert -install
```4. Update Traefik configuration in the `traefik/dynamic.yaml` file as needed.
5. Run traefik:
```bash
traefik --configFile=traefik/traefik.yaml
```6. Access the Next.js app using the configured host:
```bash
https://nextjs.localhost
```## Configuration Details
### Traefik Configuration (`traefik/dynamic.yaml`/`traefik/traefik.yaml`)
Adjust the Traefik configuration based on your requirements. This file includes settings for entry points, middleware, and SSL certificates.
## Contributing
Feel free to contribute to this project by opening issues or submitting pull requests. Your feedback and enhancements are highly appreciated!
## License
This project is licensed under the [MIT License](LICENSE.md).
---