Skip to content

Commit 808b88d

Browse files
malcyLMalcolm Landon
andauthored
feat: set nginx conf server tokens off (#104)
- https://techfromsage.atlassian.net/browse/PLT-1404 Set server_tokens off by default in nginx config Co-authored-by: Malcolm Landon <[email protected]>
1 parent b64a712 commit 808b88d

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

examples/advanced-web-service/__snapshots__/chart.test.ts.snap

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ upstream application {
7676
server {
7777
listen 80;
7878
server_name localhost;
79+
server_tokens off;
7980
8081
gzip on;
8182
gzip_comp_level 4;
@@ -189,7 +190,7 @@ proxy_cookie_path / "/$cookie_path_patches";
189190
"region": "local",
190191
"service": "advanced-development-local",
191192
},
192-
"name": "nginx-config-g87b2gc9mg",
193+
"name": "nginx-config-64ttdhkh54",
193194
"namespace": "advanced-test",
194195
},
195196
},
@@ -621,7 +622,7 @@ proxy_cookie_path / "/$cookie_path_patches";
621622
{
622623
"configMap": {
623624
"defaultMode": 292,
624-
"name": "nginx-config-g87b2gc9mg",
625+
"name": "nginx-config-64ttdhkh54",
625626
},
626627
"name": "nginx-config",
627628
},
@@ -709,6 +710,7 @@ upstream application {
709710
server {
710711
listen 80;
711712
server_name localhost;
713+
server_tokens off;
712714
713715
gzip on;
714716
gzip_comp_level 4;
@@ -822,7 +824,7 @@ proxy_cookie_path / "/$cookie_path_patches";
822824
"region": "local",
823825
"service": "advanced-development-local",
824826
},
825-
"name": "nginx-config-g87b2gc9mg",
827+
"name": "nginx-config-64ttdhkh54",
826828
"namespace": "advanced-test",
827829
},
828830
},
@@ -1111,7 +1113,7 @@ proxy_cookie_path / "/$cookie_path_patches";
11111113
{
11121114
"configMap": {
11131115
"defaultMode": 292,
1114-
"name": "nginx-config-g87b2gc9mg",
1116+
"name": "nginx-config-64ttdhkh54",
11151117
},
11161118
"name": "nginx-config",
11171119
},
@@ -1474,7 +1476,7 @@ proxy_cookie_path / "/$cookie_path_patches";
14741476
{
14751477
"configMap": {
14761478
"defaultMode": 292,
1477-
"name": "nginx-config-g87b2gc9mg",
1479+
"name": "nginx-config-64ttdhkh54",
14781480
},
14791481
"name": "nginx-config",
14801482
},
@@ -1562,6 +1564,7 @@ upstream application {
15621564
server {
15631565
listen 80;
15641566
server_name localhost;
1567+
server_tokens off;
15651568
15661569
gzip on;
15671570
gzip_comp_level 4;
@@ -1675,7 +1678,7 @@ proxy_cookie_path / "/$cookie_path_patches";
16751678
"region": "local",
16761679
"service": "advanced-development-local",
16771680
},
1678-
"name": "nginx-config-g87b2gc9mg",
1681+
"name": "nginx-config-64ttdhkh54",
16791682
"namespace": "advanced-test",
16801683
},
16811684
},
@@ -2107,7 +2110,7 @@ proxy_cookie_path / "/$cookie_path_patches";
21072110
{
21082111
"configMap": {
21092112
"defaultMode": 292,
2110-
"name": "nginx-config-g87b2gc9mg",
2113+
"name": "nginx-config-64ttdhkh54",
21112114
},
21122115
"name": "nginx-config",
21132116
},
@@ -2195,6 +2198,7 @@ upstream application {
21952198
server {
21962199
listen 80;
21972200
server_name localhost;
2201+
server_tokens off;
21982202
21992203
gzip on;
22002204
gzip_comp_level 4;
@@ -2308,7 +2312,7 @@ proxy_cookie_path / "/$cookie_path_patches";
23082312
"region": "local",
23092313
"service": "advanced-development-local",
23102314
},
2311-
"name": "nginx-config-g87b2gc9mg",
2315+
"name": "nginx-config-64ttdhkh54",
23122316
"namespace": "advanced-test",
23132317
},
23142318
},
@@ -2596,7 +2600,7 @@ proxy_cookie_path / "/$cookie_path_patches";
25962600
{
25972601
"configMap": {
25982602
"defaultMode": 292,
2599-
"name": "nginx-config-g87b2gc9mg",
2603+
"name": "nginx-config-64ttdhkh54",
26002604
},
26012605
"name": "nginx-config",
26022606
},
@@ -2959,7 +2963,7 @@ proxy_cookie_path / "/$cookie_path_patches";
29592963
{
29602964
"configMap": {
29612965
"defaultMode": 292,
2962-
"name": "nginx-config-g87b2gc9mg",
2966+
"name": "nginx-config-64ttdhkh54",
29632967
},
29642968
"name": "nginx-config",
29652969
},
@@ -3047,6 +3051,7 @@ upstream application {
30473051
server {
30483052
listen 80;
30493053
server_name localhost;
3054+
server_tokens off;
30503055
30513056
gzip on;
30523057
gzip_comp_level 4;
@@ -3160,7 +3165,7 @@ proxy_cookie_path / "/$cookie_path_patches";
31603165
"region": "local",
31613166
"service": "advanced-development-local",
31623167
},
3163-
"name": "nginx-config-g87b2gc9mg",
3168+
"name": "nginx-config-64ttdhkh54",
31643169
"namespace": "advanced-test",
31653170
},
31663171
},
@@ -3591,7 +3596,7 @@ proxy_cookie_path / "/$cookie_path_patches";
35913596
{
35923597
"configMap": {
35933598
"defaultMode": 292,
3594-
"name": "nginx-config-g87b2gc9mg",
3599+
"name": "nginx-config-64ttdhkh54",
35953600
},
35963601
"name": "nginx-config",
35973602
},

lib/web-service/nginx/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ upstream application {
1111
server {
1212
listen {{nginxPort}};
1313
server_name localhost;
14+
server_tokens off;
1415

1516
gzip on;
1617
gzip_comp_level 4;

test/web-service/__snapshots__/nginx-util.test.ts.snap

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ upstream application {
3939
server {
4040
listen 80;
4141
server_name localhost;
42+
server_tokens off;
4243
4344
gzip on;
4445
gzip_comp_level 4;
@@ -81,7 +82,7 @@ server {
8182
"labels": {
8283
"prunable": "true",
8384
},
84-
"name": "test-nginx-config-c88fe926-9d5ctddt9h",
85+
"name": "test-nginx-config-c88fe926-77btht5dbt",
8586
},
8687
},
8788
]
@@ -105,6 +106,7 @@ upstream application {
105106
server {
106107
listen 80;
107108
server_name localhost;
109+
server_tokens off;
108110
109111
gzip on;
110112
gzip_comp_level 4;
@@ -147,7 +149,7 @@ server {
147149
"labels": {
148150
"prunable": "true",
149151
},
150-
"name": "test-nginx-config-c88fe926-7b7f6cfmf4",
152+
"name": "test-nginx-config-c88fe926-ckc2bm4fb5",
151153
},
152154
},
153155
]
@@ -190,6 +192,7 @@ upstream application {
190192
server {
191193
listen 80;
192194
server_name localhost;
195+
server_tokens off;
193196
194197
gzip on;
195198
gzip_comp_level 4;
@@ -243,7 +246,7 @@ server {
243246
"labels": {
244247
"prunable": "true",
245248
},
246-
"name": "test-nginx-config-c88fe926-99528m62bg",
249+
"name": "test-nginx-config-c88fe926-5cfhb96cfc",
247250
},
248251
},
249252
]
@@ -267,6 +270,7 @@ upstream application {
267270
server {
268271
listen 80;
269272
server_name localhost;
273+
server_tokens off;
270274
271275
gzip on;
272276
gzip_comp_level 4;
@@ -333,7 +337,7 @@ location /api/auth/login {
333337
"labels": {
334338
"prunable": "true",
335339
},
336-
"name": "test-nginx-config-c88fe926-mdm92m6fhh",
340+
"name": "test-nginx-config-c88fe926-52gf5fdthm",
337341
},
338342
},
339343
]

0 commit comments

Comments
 (0)