diff --git a/virtualinsanity/virtualinsanity-nginx-conf-cm.yaml b/virtualinsanity/virtualinsanity-nginx-conf-cm.yaml new file mode 100644 index 0000000..e9c5d5f --- /dev/null +++ b/virtualinsanity/virtualinsanity-nginx-conf-cm.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: virtualinsanity-nginx-conf + namespace: wordpress +data: + default.conf: | + server { + listen 80; + server_name virtualinsanity.giaco.net; + + root /var/www/html; + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ /index.php?$args; + } + + location ~ \.php$ { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass wordpress:9000; # Assumes 'wordpress' is the container name in the same pod + + location ~ /\.ht { + deny all; + } + } + + location ~* /(wp-config\.php|readme\.html|license\.txt) { + deny all; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1y; + log_not_found off; + access_log off; + } + + error_page 404 /index.php; \ No newline at end of file diff --git a/virtualinsanity/virtualinsanity-wordpress-svc.yaml b/virtualinsanity/virtualinsanity-wordpress-svc.yaml new file mode 100644 index 0000000..1142d7c --- /dev/null +++ b/virtualinsanity/virtualinsanity-wordpress-svc.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: virtualinsanity-wordpress-svc + namespace: wordpress +spec: + selector: + app: wordpress + site: virtualinsanity + ports: + - protocol: TCP + port: 80 + targetPort: 80 + type: ClusterIP \ No newline at end of file