
自宅のサーバーに seafile サーバーをデプロイしました。seafile のデプロイは成功し、エラーも発生しませんでした。そこで、nginx をセットアップしてみました。
私の nginx 設定:
server {
root /var/www/mydomain;
index index.html;
server_name mydomain.de
return 301 mydomain.de$request_uri;
}
server {
root /var/www/mydomain;
index index.html;
server_name http://www.mydomain.de;
}
server {
listen 80;
server_name www.cloud.mydomain.de;
proxy_set_header X-Forwarded-For $remote_addr;
location / {
fastcgi_pass 127.0.0.1:8000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REMOTE_ADDR $remote_addr;
access_log /var/log/nginx/seahub.access.log;
error_log /var/log/nginx/seahub.error.log;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
}
location /media {
root /home/myuser/seafile/seafile-server-latest/seahub;
}
}
私のccnet.conf:
SERVICE_URL = http://www.cloud.mydomain.de
seahub_settings.py (最後の行):
FILE_SERVER_ROOT = 'http://www.cloud.mydomain.de/seafhttp'
最初の 2 つのサーバー ブロックは正常に動作し、期待どおりです。ただし、www.cloud.mydomain.de にアクセスしようとすると、空白のページが表示されます (www.cloud.mydomain.de/defaultsite にリダイレクトされます)。
http://www.cloud.mydomain.de/ => redirect to /defaultsite (cause of domain hoster?) and blank page
http://www.cloud.mydomain.de/seafhttp => blank page
http://www.cloud.mydomain.de/media => blank page
ただし、次の方法で seafile サーバーが実行中であることを確認しました。
./seafile.sh start
./seahub.sh start-fastcgi
私の問題を解決できる提案はありますか?
答え1
server_name http://www.mydomain.de;
正しくありません。
ディレクティブにはドメイン名のみが追加されserver_name
、プロトコルは含まれません。
また、最初のserver
ブロックの行にはセミコロンがないのでserver_name
、これも機能しないはずです。
実際、最初の 2 つのserver
ブロックは意味がありません。最初のブロックは、301
リダイレクトのプロトコルを含まないリダイレクトを構成します。return
ディレクティブにはプロトコルを含める必要があります。
DNS がwww.cloud.mydomain.de
正しく設定されていることを確認していますか?