wblog/config/nginx.conf.example

45 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

2018-01-21 02:01:09 +08:00
upstream wblog {
server unix:///data/www/wblog/shared/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name example.com;
root /data/www/wblog/current/public;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
location /cable {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://wblog;
}
location ~ ^/(uploads)/ {
expires max;
break;
}
try_files $uri/index.html $uri @wblog;
location @wblog {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://wblog;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 20M;
keepalive_timeout 10;
}