-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
40 lines (33 loc) · 984 Bytes
/
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
worker_processes 1;
daemon off;
error_log <%= ENV["APP_ROOT"] %>/nginx/logs/error.log;
events { worker_connections 1024; }
http {
charset utf-8;
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
access_log <%= ENV["APP_ROOT"] %>/nginx/logs/access.log cloudfoundry;
default_type application/octet-stream;
include mime.types;
sendfile on;
server {
listen <%= ENV["PORT"] %>;
server_name localhost;
location / {
root <%= ENV["APP_ROOT"] %>/public;
index index.html index.htm Default.htm;
# Push state
if (!-e $request_filename) {
rewrite ^(.*)$ / break;
}
index index.html index.htm Default.htm;
# No trailing slash in `API_ENDPOINT`
location /api/ {
proxy_pass <%= ENV["API_ENDPOINT"] %>/api/;
}
# Trailing Slash required
location /mw {
proxy_pass <%= ENV["API_ENDPOINT"] %>/;
}
}
}
}