-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
42 lines (36 loc) · 2.04 KB
/
nginx.conf
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
http {
# Upstream server definition
upstream omnisive {
server omnisive-server:8080;
}
# Server block for localhost proxying
server {
listen 80;
listen [::]:80;
# server_name localhost;
location / {
proxy_pass http://omnisive; # Passes the request to the upstream server
proxy_http_version 1.1; # Passes the HTTP version to the upstream
proxy_set_header Upgrade $http_upgrade; # Passes the Upgrade header to the upstream
proxy_set_header Connection "upgrade"; # Passes the Connection header to the upstream
proxy_set_header Host $host; # Passes the Host header to the upstream
proxy_set_header Cookie $http_cookie; # Passes the Cookie header to the upstream
proxy_cache_bypass $http_upgrade; # Bypasses the cache for WebSocket connections
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Passes the real IP of the client to the upstream
proxy_set_header X-Forwarded-Proto $scheme; # Passes the real IP of the client to the upstream
}
# WebSocket support for the upstream server
location /ws {
proxy_pass http://omnisive; # Passes the request to the upstream server
proxy_http_version 1.1; # Passes the HTTP version to the upstream
proxy_set_header Upgrade $http_upgrade; # Passes the Upgrade header to the upstream
proxy_set_header Connection "upgrade"; # Passes the Connection header to the upstream
proxy_set_header Host $host; # Passes the Host header to the upstream
proxy_set_header Cookie $http_cookie; # Passes the Cookie header to the upstream
proxy_cache_bypass $http_upgrade; # Bypasses the cache for WebSocket connections
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Passes the real IP of the client to the upstream
proxy_set_header X-Forwarded-Proto $scheme; # Passes the real IP of the client to the upstream
}
}
}
events {}