-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.conf
38 lines (30 loc) · 1 KB
/
example.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
server {
listen *:80;
listen *:443 ssl http2;
ssl_certificate /var/ssl/example.com.crt;
ssl_certificate_key /var/ssl/example.com.key;
server_name example.com;
access_log /var/log/nginx/example.access.log;
error_log /var/log/nginx/example.error.log;
root /var/www/html;
index index.html index.htm index.php;
if ($scheme = http){
return 301 https://$server_name$request_uri;
}
client_max_body_size 10M;
location / {
resolver 127.0.0.11 valid=30s;
# fix: nginx [emerg] host not found in upstream
set $upstream ghost;
proxy_pass http://$upstream:2368;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTPS $https;
}
location /ip {
default_type application/json;
return 200 "{\"ip\":\"$remote_addr\"}";
}
}