-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
90 lines (73 loc) · 2.86 KB
/
nginx.conf
File metadata and controls
90 lines (73 loc) · 2.86 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
user www;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
access_log /var/log/nginx/access.log;
keepalive_timeout 3000;
client_max_body_size 100m;
gzip on;
gzip_disable "msie6";
gzip_min_length 256;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf application/x-font-woff font/opentype image/svg+xml image/x-icon;
#caching
proxy_cache_path /ghostcache levels=1:2 keys_zone=ghostcache:60m max_size=300m inactive=24h;
proxy_cache_key "$scheme$request_method$host$request_uri";
proxy_cache_methods GET HEAD;
server {
listen 0.0.0.0:{{PORT}};
root /var/www/ghost/content/static;
location / {
try_files $uri @cache;
}
location /ghost/ {
root /var/www/ghost/core/built/assets;
try_files $uri uri/ @ghost;
}
location /p/ {
try_files $uri @ghost;
}
location /content/images/ {
root /var/www/ghost;
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri $uri/ @cache;
}
location /assets/ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri $uri/ @cache;
}
location @ghost {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:2368;
proxy_redirect off;
}
location @cache {
proxy_cache ghostcache;
proxy_cache_valid 1m;
proxy_cache_valid 404 1m;
proxy_ignore_headers Set-Cookie;
proxy_hide_header Set-Cookie;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_ignore_headers Cache-Control;
add_header X-Cache-Status $upstream_cache_status;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:2368;
proxy_redirect off;
}
}
}