Skip to content

Commit e91efd3

Browse files
committed
modify nginx config
1 parent 2e11339 commit e91efd3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

config/server/nginx.conf.erb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ server {
2323
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2424
proxy_set_header X-Forwarded-Proto $scheme;
2525
proxy_set_header Host $host;
26+
proxy_set_header X-Sendfile-Type X-Accel-Redirect;
27+
proxy_set_header X-Accel-Mapping <%= api_dir %>/shared/uploads/=/files/;
2628
proxy_hide_header X-Powered-By;
2729

2830
error_page 503 @503;
@@ -42,12 +44,12 @@ server {
4244
rewrite ^/api(/.*)$ $1 break;
4345
}
4446

45-
location ~ ^/uploads(/.*|$) {
46-
root <%= api_dir %>/current/public;
47-
gzip_static on;
47+
location /files/ {
48+
internal;
49+
alias <%= api_dir %>/current/uploads/;
4850
}
4951

50-
location ~ ^/(admin|private|rails|health_check)(/.*|$) {
52+
location ~ ^/(admin|uploads|private|rails|health_check)(/.*|$) {
5153
root <%= api_dir %>/current/public;
5254

5355
proxy_connect_timeout 600;

0 commit comments

Comments
 (0)