Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 8c749d8

Browse files
committed
Adds nginx config edit to increase max url size
Signed-off-by: JoshVanL <[email protected]>
1 parent d4d2a72 commit 8c749d8

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

demo/manifests/components/landingpage.jsonnet

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ local utils = import '../vendor/kube-prod-runtime/lib/utils.libsonnet';
33

44
local IMAGE = 'nginx:1.15.12';
55
local WWW_VOLUME_PATH = '/usr/share/nginx/html';
6-
local CONFIG_PATH = '/etc/nginx/conf.d';
6+
local CONFIG_TOP_LEVEL_PATH = '/etc/nginx/nginx.conf';
7+
local CONFIG_DEFAULT_PATH = '/etc/nginx/conf.d';
78
local HTTP_PORT = 80;
89

910
{
@@ -46,6 +47,38 @@ local HTTP_PORT = 80;
4647

4748
configMap: kube.ConfigMap($.name) + $.metadata {
4849
data+: {
50+
'nginx.conf': |||
51+
user nginx;
52+
worker_processes 1;
53+
54+
error_log /var/log/nginx/error.log warn;
55+
pid /var/run/nginx.pid;
56+
57+
58+
events {
59+
worker_connections 1024;
60+
}
61+
62+
63+
http {
64+
include /etc/nginx/mime.types;
65+
default_type application/octet-stream;
66+
67+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
68+
'$status $body_bytes_sent "$http_referer" '
69+
'"$http_user_agent" "$http_x_forwarded_for"';
70+
71+
access_log /var/log/nginx/access.log main;
72+
73+
sendfile on;
74+
75+
keepalive_timeout 65;
76+
77+
server_names_hash_bucket_size 256;
78+
79+
include /etc/nginx/conf.d/*.conf;
80+
}
81+
|||,
4982
'default.conf': |||
5083
server {
5184
listen 80;
@@ -135,14 +168,22 @@ local HTTP_PORT = 80;
135168
landingpage: kube.Container($.app) {
136169
local container = self,
137170
image: IMAGE,
171+
args: [
172+
'nginx',
173+
'-g',
174+
'daemon off;',
175+
'-c',
176+
CONFIG_TOP_LEVEL_PATH,
177+
],
138178
resources: {
139179
requests: { cpu: '10m', memory: '64Mi' },
140180
},
141181
ports_+: {
142182
http: { containerPort: HTTP_PORT },
143183
},
144184
volumeMounts_+: {
145-
config: { mountPath: CONFIG_PATH },
185+
config_top_level: { name: 'config', mountPath: CONFIG_TOP_LEVEL_PATH, subPath: 'nginx.conf' },
186+
config_default: { name: 'config', mountPath: CONFIG_DEFAULT_PATH + '/default.conf', subPath: 'default.conf' },
146187
} + if $.index then { www: { mountPath: WWW_VOLUME_PATH } } else {},
147188
readinessProbe: {
148189
httpGet: { path: '/', port: HTTP_PORT },

0 commit comments

Comments
 (0)