forked from 9958/NEMBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blog_nginx.conf
43 lines (36 loc) · 1001 Bytes
/
blog_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
upstream moguf_upstream {
server 127.0.0.1:3000;
keepalive 64;
}
server {
listen 80;
server_name moguf.com;
return 301 $scheme://www.moguf.com$request_uri;
}
server {
listen 80;
server_name www.moguf.com;
error_page 502 /errors/502.html;
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) {
root /home/myweb/blog/public;
access_log off;
expires max;
}
location /errors {
internal;
alias /home/myweb/blog/public/errors;
}
location / {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_cache one;
proxy_cache_key sfs$request_uri$scheme;
proxy_pass http://moguf_upstream;
}
}