I freshly installed a docker compose deployment for 7.1.14 Seafile pro.
Everything works as expected except the profile picture. It tries to access it on port 8000 when my docker-compose is open on 8081. This is what I see on the rendered page while accessing http://adyanth-pc-amd:8081/
<script type="text/javascript">
window.app = {
config: {
mediaUrl: '/media/',
logoPath: 'img/seafile-logo.png',
logoWidth: '',
logoHeight: '32',
faviconPath: 'img/favicon.ico',
loginBGPath: 'img/login-bg.jpg',
siteTitle: 'Adyanth's Seafile',
siteName: 'Seafile',
siteRoot: '/',
loginUrl: '/accounts/login/',
logoutUrl: '/accounts/logout/',
isPro: 'True',
isDocs: 'False',
lang: 'en',
fileServerRoot: 'http://adyanth-pc-amd:8081/seafhttp/',
serviceURL: 'http://adyanth-pc-amd:8081',
seafileVersion: '7.1.14',
avatarURL: 'http://adyanth-pc-amd.lan:8000/media/avatars/default.png'
},
The last line is wrong, that .lan was given in the compose file SEAFILE_SERVER_HOSTNAME=adyanth-pc-amd.lan and the port 8000 idk where it is getting from.
Followed a profile photo issue post here which suggested adding the below to seahub_settings.py:
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
The nginx.conf is as below:
# -*- mode: nginx -*-
# Auto generated at 03/03/2021 16:53:13
server {
listen 80;
server_name adyanth-pc-amd.lan;
client_max_body_size 10m;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_read_timeout 310s;
proxy_set_header Host $host;
proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "";
proxy_http_version 1.1;
client_max_body_size 0;
access_log /var/log/nginx/seahub.access.log seafileformat;
error_log /var/log/nginx/seahub.error.log;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_request_buffering off;
access_log /var/log/nginx/seafhttp.access.log seafileformat;
error_log /var/log/nginx/seafhttp.error.log;
}
location /seafdav {
proxy_pass http://127.0.0.1:8080;
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_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1200s;
client_max_body_size 0;
access_log /var/log/nginx/seafdav.access.log seafileformat;
error_log /var/log/nginx/seafdav.error.log;
}
location /media {
root /opt/seafile/seafile-server-latest/seahub;
}
# For letsencrypt
location /.well-known/acme-challenge/ {
alias /var/www/challenges/;
try_files $uri =404;
}
}
Not sure if that needs a rewrite as well.
Please help me fix this one tiny but annoying issue. TIA!