forked from carbon-design-system/carbon-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
59 lines (48 loc) · 1.16 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
worker_processes 1;
daemon off;
error_log stderr;
events { worker_connections 1024; }
http {
charset utf-8;
default_type application/octet-stream;
include mime.types;
keepalive_timeout 15;
autoindex off;
server_tokens off;
port_in_redirect off;
sendfile on;
tcp_nopush on;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/javascript
application/json
application/x-javascript
application/rss+xml
text/javascript
text/css
text/plain
image/svg+xml;
log_format cloudfoundry 'NginxLog "$request" $status $body_bytes_sent';
access_log /dev/stdout cloudfoundry;
server {
listen {{port}};
server_name localhost;
root public;
## force https
set $updated_host $host;
if ($http_x_forwarded_host != "") {
set $updated_host $http_x_forwarded_host;
}
if ($http_x_forwarded_proto != "https") {
return 301 https://$updated_host$request_uri;
}
index index.html;
autoindex off;
error_page 404 /404;
include conf.d/*.conf;
}
}