-
Notifications
You must be signed in to change notification settings - Fork 5
/
nginx.conf
59 lines (49 loc) · 1.81 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
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
map_hash_bucket_size 128;
port_in_redirect off;
map $http_host $host_without_port {
~^(.+):\d+$ $1;
default $http_host;
}
map $request_uri $redirect_url {
~^/flavors/overview/?$ https://cncframework.com/reference-architectures/overview/;
~^/flavors/aws/ecs/?$ https://cncframework.com/reference-architectures/aws/ecs/;
~^/flavors/gcp/run/?$ https://cncframework.com/reference-architectures/gcp/run/;
~^/flavors/gcp/run-lite/?$ https://cncframework.com/reference-architectures/gcp/run-lite/;
~^/flavors/gcp/gke/?$ https://cncframework.com/reference-architectures/gcp/gke/;
}
server {
listen 8080;
server_name _;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host_without_port;
proxy_cache_bypass $http_upgrade;
proxy_buffers 4 16k;
proxy_buffer_size 8k;
proxy_busy_buffers_size 16k;
gzip on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
if ($redirect_url) {
return 301 $redirect_url;
}
location / {
proxy_set_header Host $host_without_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
root /usr/share/nginx/html;
try_files $uri $uri/ =404;
}
}
}