-
Notifications
You must be signed in to change notification settings - Fork 11
/
nginx.conf
49 lines (40 loc) · 887 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
41
42
43
44
45
46
47
48
49
load_module modules/ngx_http_brotli_filter_module.so;
load_module modules/ngx_http_brotli_static_module.so;
daemon off;
user nginx nginx;
worker_processes 1;
error_log stderr warn;
worker_rlimit_nofile 8192;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
sendfile on;
tcp_nopush on;
gzip_static on;
brotli_static on;
port_in_redirect off;
server_name_in_redirect off;
# Redirects
map_hash_bucket_size 256;
map $request_uri $uri_without_slash {
"~(?<u>(.+))/$" $u;
default $request_uri;
}
map $uri_without_slash $redirect_uri {
include redirects.map;
default "";
}
server {
listen 8080;
access_log /dev/stdout;
root /app/public;
if ($redirect_uri != "") {
rewrite ^(.*)$ $redirect_uri redirect;
}
index index.html;
error_page 404 /404.html;
}
}