-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
44 lines (39 loc) · 1.12 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
############################ main
server {
### server
listen $PORT;
server_name localhost $SERVICE.modolib.site;
client_max_body_size 10M;
### location
location / {
root /home/ubuntu/production/$URL;
index index.html index.htm;
try_files $uri /index.html;
add_header Access-Control-Allow-Origin *;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# server rewrites
location /request {
rewrite ^/request/?(.*) /$1 break;
proxy_pass https://modolib.com;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
}
### gzip settings
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
}
############################# redirect to main URL
server {
listen $PORT;
server_name modolib.site;
# Redirect to www.modolib.site
return 301 http://www.modolib.site$request_uri;
}