-
Notifications
You must be signed in to change notification settings - Fork 0
/
server-location.conf
34 lines (29 loc) · 1.07 KB
/
server-location.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
server {
set $api_name -;
access_log /var/log/nginx/api_access.log api.example.com;
listen 80;
server_name api.example.com;
# TLS config
listen 443 ssl;
ssl_certificate /etc/ssl/certs/api.example.com.crt;
ssl_certificate_key /etc/ssl/private/api.example.com.key;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_protocols TLSv1.1 TLSv1.2;
# API definitions, one per file
location /api/warehouse/pricing {
set $upstream warehouse_pricing;
rewrite ^ /_warehouse last;
}
location = /_warehouse {
internal;
set $api_name "Warehouse";
proxy_pass http://$upstream$request_uri;
}
# Error responses
error_page 404 = @400; # Invalid paths are treated as bad requests
proxy_intercept_errors on; # Do not send backend errors to the client
include error_page.conf; # API client friendly JSON error responses
default_type application/json; # If no content-type then assume JSON
}