-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnginx.conf
89 lines (66 loc) · 2.25 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
worker_processes auto;
error_log /dev/stderr warn;
pid /tmp/nginx/nginx.pid;
events {
worker_connections 1024;
}
http {
open_file_cache max=1000 inactive=60s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
# running as non-root requires a writeable path
client_body_temp_path /tmp/nginx/client_temp;
proxy_temp_path /tmp/nginx/proxy_temp;
fastcgi_temp_path /tmp/nginx/fastcgi_temp;
uwsgi_temp_path /tmp/nginx/uwsgi_temp;
scgi_temp_path /tmp/nginx/scgi_temp;
charset utf-8;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
# Enable gzip
gzip on;
gzip_static on;
gzip_comp_level 6;
gzip_min_length 512;
gzip_vary on;
gzip_proxied any;
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript application/javascript
application/atom+xml application/json
image/svg+xml;
server {
listen 8080;
server_name localhost;
# To prevent sending clients to the wrong server
# http://docs.giantswarm.io/...
# https://github.com/giantswarm/roadmap/issues/1514
absolute_redirect off;
server_tokens off;
port_in_redirect off;
chunked_transfer_encoding on;
location / {
root /usr/share/nginx/html;
# We only store compressed HTML in this directory
# so the index directive cannot be used.
rewrite ^(.*)/$ $1/index.html last;
gzip_static always;
gunzip on;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}