fix
This commit is contained in:
@@ -103,3 +103,92 @@ resource "kubectl_manifest" "cm_scripts" {
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
resource "kubectl_manifest" "cm_nginx" {
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "${var.instance}-${var.component}-nginx"
|
||||
namespace: ${var.namespace}
|
||||
labels: ${jsonencode(local.common_labels)}
|
||||
data:
|
||||
default.conf: |-
|
||||
server {
|
||||
listen 8080 default_server;
|
||||
|
||||
client_max_body_size 100M;
|
||||
charset utf-8;
|
||||
|
||||
# Frontend
|
||||
location / {
|
||||
proxy_pass http://${kubectl_manifest.svc_front.name}/;
|
||||
proxy_pass_header Server;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
# Api
|
||||
location /api {
|
||||
proxy_pass http://${kubectl_manifest.svc_back.name}:8000/api;
|
||||
proxy_pass_header Server;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
# Admin
|
||||
location /admin {
|
||||
proxy_pass http://${kubectl_manifest.svc_back.name}:8000/admin;
|
||||
proxy_pass_header Server;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
# Static
|
||||
location /static {
|
||||
root /taiga;
|
||||
}
|
||||
|
||||
# Media
|
||||
location /_protected {
|
||||
internal;
|
||||
alias /taiga/media/;
|
||||
add_header Content-disposition "attachment";
|
||||
}
|
||||
|
||||
# Unprotected section
|
||||
location /media/exports {
|
||||
alias /taiga/media/exports/;
|
||||
add_header Content-disposition "attachment";
|
||||
}
|
||||
|
||||
location /media {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://${kubectl_manifest.svc_protected.name}:8003/;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# Events
|
||||
location /events {
|
||||
proxy_pass http://${kubectl_manifest.svc_events.name}:8888/events;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_connect_timeout 7d;
|
||||
proxy_send_timeout 7d;
|
||||
proxy_read_timeout 7d;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user