forked from hedudelgado/impac-express
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
71 lines (62 loc) · 2.63 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
# Default MNOE nginx configuration for the web-ruby docker image used by Nex!™:
# https://github.com/maestrano/docker-web-ruby
server {
listen 80 default_server;
server_name _;
root /app/public;
try_files $uri/index.html $uri @app;
#-----------------------------------------------------------
# Mnoe custom caching configuration
#-----------------------------------------------------------
# Empty location block to force the html block to trigger
location ~* ^/(admin|dashboard)/$ {
}
# Revalidate html pages on each request and fetch the latest version if the content change
location ~* \.(html?|json)$ {
add_header Cache-Control "max-age=0, must-revalidate";
}
# Same for config.js
location ~* config\.js$ {
add_header Cache-Control "max-age=0, must-revalidate";
}
# CSS and Javascript
# "far future expires" of 1 year as the assets are fingerprinted
location ~* \.(?:css|js)$ {
add_header Cache-Control "max-age=31536000";
# access_log off;
}
#-----------------------------------------------------------
# Proxy to Puma
#-----------------------------------------------------------
location @app {
# # Wide-open CORS config
# if ($request_method = 'OPTIONS') {
# add_header 'Access-Control-Allow-Origin' '*';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# add_header 'Access-Control-Allow-Headers' 'Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,x-csrf-token,Authorization';
# add_header 'Access-Control-Max-Age' 1728000;
# add_header 'Content-Type' 'text/plain charset=UTF-8';
# add_header 'Content-Length' 0;
# return 204;
# }
# if ($request_method = 'POST') {
# add_header 'Access-Control-Allow-Origin' '*';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# add_header 'Access-Control-Allow-Headers' 'Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,x-csrf-token,Authorization';
# }
# if ($request_method = 'GET') {
# add_header 'Access-Control-Allow-Origin' '*';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# add_header 'Access-Control-Allow-Headers' 'Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
# }
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}