-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
51 lines (42 loc) · 1 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
43
44
45
46
47
48
49
50
51
server {
listen 8080;
server_name _;
sendfile on;
tcp_nopush on;
gzip on;
gzip_types *;
gzip_proxied any;
# If you uncomment this, the credentials are: test/test
# auth_basic "Private";
# auth_basic_user_file /etc/nginx/basic_auth;
# Block specific user agents
if ($http_user_agent ~* (Wget|Curl) ) {
return 403;
}
# Don't serve dotfiles (.env, .git, etc...)
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Block a known internal convention for auth caches
location /auth {
deny all;
access_log off;
log_not_found off;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Nginx-Proxy true;
proxy_pass http://nodeapp;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
}
upstream nodeapp {
server node_app_server:3000;
server node_app_server:3001;
server node_app_server:3002;
}