
방금 홈 서버에 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'
처음 두 서버 블록은 예상대로 잘 작동합니다. 하지만 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
작동하지 않습니다.
실제로 첫 번째 두 server
블록은 의미가 없습니다. 첫 번째 블록은 301
리디렉션에 대한 프로토콜을 포함하지 않는 리디렉션을 구성합니다. return
지시문에는 프로토콜이 포함되어야 합니다.
의 DNS가 www.cloud.mydomain.de
올바르게 구성되었습니까?