-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx-snippet.conf
More file actions
40 lines (33 loc) · 832 Bytes
/
nginx-snippet.conf
File metadata and controls
40 lines (33 loc) · 832 Bytes
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
map $http_user_agent $ipaddrcaindex {
default /index.html;
~curl /ip;
~Python-urllib /ip;
}
server {
listen 80;
listen [::]:80;
server_name ipaddr.ca 4.ipaddr.ca 6.ipaddr.ca www.ipaddr.ca;
root /home/ipaddr/public_html;
charset utf-8;
access_log /var/log/nginx/ipaddr_ca_access.log;
error_log /var/log/nginx/ipaddr_ca_error.log;
# rewritten index
location = / { rewrite ^ $ipaddrcaindex; }
# staticly serve files
location / {
try_files $uri $uri/ $uri.html =404;
}
# revproxy endpoints
location /ip {
include uwsgi_params;
uwsgi_pass unix:/home/website/ipaddr-python/ipaddrca.sock;
}
location /ptr {
include uwsgi_params;
uwsgi_pass unix:/home/website/ipaddr-python/ipaddrca.sock;
}
location /api/ {
include uwsgi_params;
uwsgi_pass unix:/home/website/ipaddr-python/ipaddrca.sock;
}
}