-
Notifications
You must be signed in to change notification settings - Fork 7
/
nginx.conf
54 lines (41 loc) · 1.01 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
52
53
54
events {
worker_connections 1024;
}
http {
resolver 127.0.0.11;
upstream backend {
server demo-app-1:8000;
# server demo-app-2:8000;
# server demo-app-3:8000;
}
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name localhost application.local;
ssl_certificate /etc/nginx/certificates/nginx/nginx.crt;
ssl_certificate_key /etc/nginx/certificates/nginx/nginx.key;
default_type text/plain;
location / {
proxy_pass http://backend;
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_connect_timeout 1s;
}
location /nginx-status {
stub_status on;
access_log off;
if ($http_authorization != "Bearer secret") {
return 401;
}
}
location = /favicon.ico {
access_log off;
return 204;
}
}
}