/
ch07_nginx.conf
30 lines (26 loc) · 1.02 KB
/
ch07_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
server {
#Basic server information
listen 443;
server_name memcache.plb.membrey.hk;
#Enable SSL and set the details
ssl on;
ssl_certificate /etc/ssl/certs/private.crt;
ssl_certificate_key /etc/ssl/private/private.key;
keepalive_timeout 60;
#Logfiles
access_log /var/log/ssl-access.log;
error_log /var/log/ssl-error.log;
location / {
#setup the Proxy for our server
#ADD THE WEB SERVERS LOCAL IP BELOW
proxy_pass http://192.168.1.2;
#Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
# Basic Proxy Config
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 https;
proxy_redirect off;
}
}