Skip to content

Commit 18d3821

Browse files
committed
add plus file
1 parent b77f4e9 commit 18d3821

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
worker_processes 1;
2+
error_log /var/log/nginx/error.log;
3+
4+
events {
5+
worker_connections 1024;
6+
}
7+
8+
http {
9+
include mime.types;
10+
default_type application/octet-stream;
11+
12+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
13+
'$status $body_bytes_sent "$http_referer" '
14+
'"$http_user_agent" "$http_x_forwarded_for" '
15+
'"$bytes_sent" "$request_length" "$request_time" '
16+
'"$gzip_ratio" $server_protocol ';
17+
18+
access_log /var/log/nginx/access.log main;
19+
20+
sendfile on;
21+
keepalive_timeout 65;
22+
23+
server {
24+
listen 8080;
25+
server_name localhost;
26+
27+
location / {
28+
root /usr/share/nginx/html;
29+
index index.html index.htm;
30+
}
31+
32+
##
33+
# Enable Metrics
34+
##
35+
location /api/ {
36+
api write=on;
37+
allow 127.0.0.1;
38+
deny all;
39+
status_zone my_location_zone1;
40+
}
41+
42+
43+
location /test {
44+
return 200 "Test Success";
45+
}
46+
47+
# redirect server error pages to the static page /50x.html
48+
#
49+
error_page 500 502 503 504 /50x.html;
50+
location = /50x.html {
51+
root /usr/share/nginx/html;
52+
}
53+
}
54+
}

test/integration/grpc_management_plane_api_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,15 @@ func TestGrpc_ConfigApply(t *testing.T) {
212212

213213
t.Run("Test 2: Valid config", func(t *testing.T) {
214214
clearManagementPlaneResponses(t)
215+
newConfigFile := "../config/nginx/nginx-with-test-location.conf"
216+
217+
if os.Getenv("IMAGE_PATH") == "/nginx-plus/agent" {
218+
newConfigFile = "../config/nginx/nginx-plus.conf"
219+
}
220+
215221
err := mockManagementPlaneGrpcContainer.CopyFileToContainer(
216222
ctx,
217-
"../config/nginx/nginx-with-test-location.conf",
223+
newConfigFile,
218224
fmt.Sprintf("/mock-management-plane-grpc/config/%s/etc/nginx/nginx.conf", nginxInstanceID),
219225
0o666,
220226
)

0 commit comments

Comments
 (0)