-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
43 lines (36 loc) · 1.19 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
events {}
http {
include mime.types;
include fastcgi.conf;
# Okay to use wildcard for public API
add_header 'Access-Control-Allow-Origin' '*';
server {
listen 8080;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 9;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 128;
gzip_types *;
location / {
if ($args) {
# Need to set variable so that rewrite expand this var literally
# and the ? here wouldn't interfere with the literal ? to mean
# dropping of query parameters
set $fargs ?$args;
rewrite ^(.+)$ $1$fargs? last;
# The alternative redirect works too, but requires
# set_escape_url in order to follow the actual URL link
# set_escape_url requires openresty variant of NGINX
# set_escape_uri $eargs $args;
# rewrite ^(.+)$ $1%%3F$eargs? redirect;
}
root /usr/share/nginx/html/static;
index index.html;
autoindex on;
}
}
}