File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
deployment/nginx/templates Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -176,12 +176,24 @@ server {
176
176
177
177
listen 0.0.0.0:80;
178
178
179
- location ~ ^/(avatars| medias) / {
179
+ location ~ ^/medias/ {
180
180
root /home/linuxfr/linuxfr.org/uploads;
181
181
}
182
182
183
- # To install the LinuxFr img service, see: https://github.com/linuxfrorg/img-LinuxFr.org
183
+ # Avatars files uploaded on linuxfr server are stored in partitions
184
+ # with folder name containing 3 digits
185
+ location ~ ^/avatars/\d\d\d/ {
186
+ root /home/linuxfr/linuxfr.org/uploads;
187
+ }
188
+
189
+ # Avatars URLs has to be served by the image service
190
+ location ~ ^/avatars/ {
191
+ # To install the LinuxFr img service, see: https://github.com/linuxfrorg/img-LinuxFr.org
192
+ proxy_pass http://localhost:8000;
193
+ }
194
+
184
195
location /img/ {
196
+ # To install the LinuxFr img service, see: https://github.com/linuxfrorg/img-LinuxFr.org
185
197
proxy_pass http://localhost:8000;
186
198
}
187
199
Original file line number Diff line number Diff line change @@ -4,10 +4,17 @@ server {
4
4
5
5
server_name ${IMAGE_DOMAIN};
6
6
7
- location ~ ^/(avatars| medias) / {
7
+ location ~ ^/medias/ {
8
8
root /var/linuxfr/uploads;
9
9
}
10
10
11
+ # Avatars files uploaded on linuxfr server are stored in partitions
12
+ # with folder name containing 3 digits
13
+ location ~ ^/avatars/\d\d\d/ {
14
+ root /var/linuxfr/uploads;
15
+ }
16
+
17
+ # All other images (avatars URLs and /img) pass by the image service
11
18
location / {
12
19
proxy_pass http://linuxfr-img:8000;
13
20
}
You can’t perform that action at this time.
0 commit comments