Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 93b239bc5a | |||
| 1ed6cac647 | |||
| e476bc9fc4 | |||
| f4f23aa7f3 | |||
| 9124eeedc1 |
+23
-7
@@ -5,13 +5,29 @@ metadata:
|
||||
namespace: manoonoils
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
- websecure
|
||||
- web
|
||||
routes:
|
||||
- match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: storefront
|
||||
port: 3000
|
||||
- kind: Rule
|
||||
match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`)
|
||||
middlewares:
|
||||
- name: redirect-https
|
||||
services:
|
||||
- name: storefront
|
||||
port: 3000
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: storefront-secure
|
||||
namespace: manoonoils
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- kind: Rule
|
||||
match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`)
|
||||
services:
|
||||
- name: storefront
|
||||
port: 3000
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
|
||||
@@ -3,6 +3,7 @@ kind: Kustomization
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- middleware.yaml
|
||||
- ingress.yaml
|
||||
images:
|
||||
- name: ghcr.io/unchainedio/manoon-headless
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: redirect-https
|
||||
namespace: manoonoils
|
||||
spec:
|
||||
redirectScheme:
|
||||
scheme: https
|
||||
permanent: true
|
||||
+5
-1
@@ -4,9 +4,13 @@ metadata:
|
||||
name: storefront
|
||||
namespace: manoonoils
|
||||
spec:
|
||||
# Use NodePort with externalTrafficPolicy: Local to preserve client source IP
|
||||
# This is required for proper client IP detection in analytics (Rybbit, etc.)
|
||||
type: NodePort
|
||||
externalTrafficPolicy: Local
|
||||
selector:
|
||||
app: storefront
|
||||
ports:
|
||||
- port: 3000
|
||||
targetPort: 3000
|
||||
type: ClusterIP
|
||||
# Let Kubernetes assign a NodePort automatically
|
||||
|
||||
@@ -10,7 +10,8 @@ export async function POST(request: NextRequest) {
|
||||
const cfConnectingIp = request.headers.get("cf-connecting-ip");
|
||||
const xForwardedFor = request.headers.get("x-forwarded-for");
|
||||
const xRealIp = request.headers.get("x-real-ip");
|
||||
const nextJsIp = request.ip;
|
||||
// @ts-ignore - ip exists at runtime but not in types
|
||||
const nextJsIp = (request as any).ip;
|
||||
|
||||
// Use the first available IP in priority order
|
||||
const clientIp =
|
||||
|
||||
Reference in New Issue
Block a user