LEFT | RIGHT |
1 gzip on; | 1 gzip on; |
2 gzip_min_length 1000; | 2 gzip_min_length 1000; |
3 gzip_types application/json text/css application/x-javascript; | 3 gzip_types application/json text/css application/x-javascript; |
4 | 4 |
5 sendfile on; | 5 sendfile on; |
6 keepalive_timeout 65; | 6 keepalive_timeout 65; |
7 | 7 |
8 location / { | 8 location / |
| 9 { |
9 root /opt/discourse/public; | 10 root /opt/discourse/public; |
10 | 11 |
11 location ~ ^/t\/[0-9]+\/[0-9]+\/avatar { | 12 location ~ ^/t\/[0-9]+\/[0-9]+\/avatar |
| 13 { |
12 expires 1d; | 14 expires 1d; |
13 add_header Cache-Control public; | 15 add_header Cache-Control public; |
14 add_header ETag ""; | 16 add_header ETag ""; |
15 } | 17 } |
16 | 18 |
17 location ~ ^/assets/ { | 19 location ~ ^/assets/ |
| 20 { |
18 expires 1y; | 21 expires 1y; |
19 add_header Cache-Control public; | 22 add_header Cache-Control public; |
20 add_header ETag ""; | 23 add_header ETag ""; |
21 break; | 24 break; |
22 } | 25 } |
23 | 26 |
24 # If the file exists as a static file serve it directly without | 27 # If the file exists as a static file serve it directly without |
25 # running all the other rewite tests on it | 28 # running all the other rewite tests on it |
26 if (-f $request_filename) { | 29 if (-f $request_filename) |
| 30 { |
27 break; | 31 break; |
28 } | 32 } |
29 | 33 |
30 proxy_set_header X-Real-IP $remote_addr; | 34 proxy_set_header X-Real-IP $remote_addr; |
31 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 35 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
32 proxy_set_header X-Forwarded-Proto $scheme; | 36 proxy_set_header X-Forwarded-Proto $scheme; |
33 proxy_set_header Host $http_host; | 37 proxy_set_header Host $http_host; |
34 if (!-f $request_filename) { | 38 if (!-f $request_filename) |
| 39 { |
35 proxy_pass http://discourse; | 40 proxy_pass http://discourse; |
36 break; | 41 break; |
37 } | 42 } |
38 } | 43 } |
LEFT | RIGHT |