Skip to content

Commit

Permalink
Add rewrite in nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
oveldman committed Feb 5, 2024
1 parent f19e6bf commit f58c106
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ metadata:
name: madworld-ingress
namespace: madworld
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "X-Forwarded-For $http_x_forwarded_for";
spec:
rules:
- host: admin.mad-world.local
http:
paths:
- path: /
- path: "/((.*(?:css|css.map|html|js|json|png)$))|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -21,7 +22,7 @@ spec:
- host: api.mad-world.local
http:
paths:
- path: /
- path: "/((.*(?:css|css.map|html|js|json|png)$))|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -31,7 +32,7 @@ spec:
- host: identity.mad-world.local
http:
paths:
- path: /
- path: "/((.*)|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -41,7 +42,7 @@ spec:
- host: log.mad-world.local
http:
paths:
- path: /
- path: "/((.*)|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -51,7 +52,7 @@ spec:
- host: shipsimulator.mad-world.local
http:
paths:
- path: /
- path: "/((.*(?:css|css.map|html|js|json|png)$))|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -61,7 +62,7 @@ spec:
- host: shipsimulator-api.mad-world.local
http:
paths:
- path: /
- path: "/((.*)|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -71,7 +72,7 @@ spec:
- host: www.mad-world.local
http:
paths:
- path: /
- path: "/((.*(?:css|css.map|html|js|json|png)$))|(.*)"
pathType: Prefix
backend:
service:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ metadata:
cert-manager.io/subject-countries: "NL"
cert-manager.io/email-sans: "[email protected]"
kubernetes.io/ingress.class: "public"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "X-Forwarded-For $http_x_forwarded_for";
spec:
Expand All @@ -41,7 +42,7 @@ spec:
- host: admin.mad-world.nl
http:
paths:
- path: /
- path: "/((.*(?:css|css.map|html|js|json|png)$))|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -51,7 +52,7 @@ spec:
- host: api.mad-world.nl
http:
paths:
- path: /
- path: "/((.*)|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -61,7 +62,7 @@ spec:
- host: identity.mad-world.nl
http:
paths:
- path: /
- path: "/((.*)|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -71,7 +72,7 @@ spec:
- host: log.mad-world.nl
http:
paths:
- path: /
- path: "/((.*)|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -81,7 +82,7 @@ spec:
- host: shipsimulator.mad-world.nl
http:
paths:
- path: /
- path: "/((.*(?:css|css.map|html|js|json|png)$))|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -91,7 +92,7 @@ spec:
- host: shipsimulator-api.mad-world.nl
http:
paths:
- path: /
- path: "/((.*)|(.*)"
pathType: Prefix
backend:
service:
Expand All @@ -101,7 +102,7 @@ spec:
- host: www.mad-world.nl
http:
paths:
- path: /
- path: "/((.*(?:css|css.map|html|js|json|png)$))|(.*)"
pathType: Prefix
backend:
service:
Expand Down

0 comments on commit f58c106

Please sign in to comment.