-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
35 lines (29 loc) · 1.06 KB
/
nginx.conf
File metadata and controls
35 lines (29 loc) · 1.06 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
# Set the number of worker processes to 4
worker_processes 4;
# Configure the maximum number of simultaneous connections for each worker process
events {
worker_connections 1024;
}
# Configuration for the HTTP server
http {
# Define an upstream server group named 'nodeapp'
upstream nodeapp {
server nodeapp:3000; # Points to the Node.js app server at 'nodeapp:3000'
}
# Server block for handling HTTP requests
server {
listen 80; # Listen on port 80 for incoming connections
server_name localhost; # Respond to requests with 'Host' header set to 'localhost'
# Location block for handling requests to the root path '/'
location / {
# Reverse proxy configuration: forward requests to the 'nodeapp' upstream server
proxy_pass http://nodeapp;
# Proxy-related directives for proper communication with the upstream server
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
}