-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathnginx.conf
More file actions
40 lines (34 loc) · 1.35 KB
/
nginx.conf
File metadata and controls
40 lines (34 loc) · 1.35 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
server {
listen 3663 ssl http2;
listen [::]:3663 ssl http2;
server_name your_domain.com; # Replace with your actual domain or IP
# SSL Configuration
ssl_certificate /path/to/your/fullchain.pem; # Replace with your certificate path
ssl_certificate_key /path/to/your/privkey.pem; # Replace with your private key path
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
location / {
proxy_pass http://localhost:3663; # Forward to the SSE server
# Headers required for SSE
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Buffering settings for SSE
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 86400s; # Keep connection open for a long time
proxy_send_timeout 86400s;
proxy_connect_timeout 75s;
# Required for SSE event stream
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
}
# Optional: Add access and error logs
access_log /var/log/nginx/sse_proxy_access.log;
error_log /var/log/nginx/sse_proxy_error.log;
}