-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwordpress-ingress.yml
72 lines (66 loc) · 2.23 KB
/
wordpress-ingress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: www-labs-lo
namespace: wordpress-test
annotations:
# This annotation meshes with “our” nginx controller, which is
# configured to accept snippets and put them into nginx.conf via a
# Golang template. (The “normal” nginx controller has snippets
# turned off, for security and robustness reasons.)
nginx.ingress.kubernetes.io/configuration-snippet: |
include "/etc/nginx/template/wordpress_fastcgi.conf";
location = /labs/lo/wp-admin {
return 301 https://wpn.fsd.team/labs/lo/wp-admin/;
}
location ~ (wp-includes|wp-admin|wp-content/(plugins|mu-plugins|themes))/ {
rewrite .*/((wp-includes|wp-admin|wp-content/(plugins|mu-plugins|themes))/.*) /$1 break;
root /wp/6/;
}
location ~ (wp-content/uploads)/ {
rewrite .*/(wp-content/uploads/(.*)) /$2 break;
root /data/www-labs-lo/uploads/;
}
fastcgi_param WP_DEBUG true;
fastcgi_param WP_ROOT_URI /labs/lo/;
fastcgi_param WP_SITE_NAME www-labs-lo;
fastcgi_param WP_ABSPATH /wp/6/;
fastcgi_param WP_DB_HOST mariadb-min;
fastcgi_param WP_DB_NAME wp-db-www-labs-lo;
fastcgi_param WP_DB_USER wp-db-user-www-labs-lo;
fastcgi_param WP_DB_PASSWORD secret;
spec:
ingressClassName: wordpress
rules:
- host: "wpn.fsd.team"
http:
paths:
- pathType: Prefix
path: /labs/lo
backend:
service:
name: wpn-nginx-service
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: www-schools-sti
namespace: wordpress-test
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: |
# Configuration for www-schools-sti goes here.
spec:
ingressClassName: wordpress
rules:
- host: "wpn.fsd.team"
http:
paths:
- pathType: Prefix
path: /schools/sti/
backend:
service:
name: wpn-nginx-service
port:
number: 80