-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
94 lines (78 loc) · 2.7 KB
/
nginx.conf
File metadata and controls
94 lines (78 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Log format
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
# Basic settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server {
listen 8080;
server_name localhost;
# Status endpoint for health checks and monitoring
location /status {
stub_status on;
access_log off;
allow all;
}
# Config endpoint to serve nginx.conf content
location /nginx_conf {
alias /etc/nginx/nginx.conf;
add_header Content-Type text/plain;
}
# Default location
location / {
return 200 "NGINX MCP Server is running!\nTimestamp: $time_iso8601\nServer: $server_name\nPort: $server_port";
add_header Content-Type text/plain;
}
# Health check endpoint
location /health {
return 200 "healthy";
add_header Content-Type text/plain;
}
}
# HTTPS server with SSL
server {
listen 8443 ssl;
http2 on;
server_name localhost;
# SSL configuration
ssl_certificate /etc/nginx/ssl/selfsigned.crt;
ssl_certificate_key /etc/nginx/ssl/selfsigned.key;
# SSL security settings
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
# Status endpoint for health checks and monitoring
location /status {
stub_status on;
access_log off;
allow all;
}
# Config endpoint to serve nginx.conf content
location /nginx_conf {
alias /etc/nginx/nginx.conf;
add_header Content-Type text/plain;
}
# Default location
location / {
return 200 "NGINX MCP Server is running over HTTPS!\nTimestamp: $time_iso8601\nServer: $server_name\nPort: $server_port\nSSL: enabled";
add_header Content-Type text/plain;
}
# Health check endpoint
location /health {
return 200 "healthy SSL";
add_header Content-Type text/plain;
}
}
}