网页(https)访问提示:404 Not Found

系统:ubuntu 16.0.4 + nginx https
Seafile6.0.4

大家好,我在一个月前成功安装并运行过seafile(用的是nginx+https),但两周前不知为什么,用浏览器访问网站就提示404 Not Found。
请教:这个问题是为什么?该如何解决?

谢谢大家

检查下你的服务器各组件是否运作正常

我刚刚查看了一遍,没有找到问题所在。现把有关信息贴上来,麻烦你看看:
sudo ps aux|grep seafile

seafile 1939 0.0 0.0 54748 2836 ? Ss 11:33 0:00 /datastorage/seafile/seafile-server-6.0.4/seafile/bin/seafile-controller -c /datastorage/seafile/ccnet -d /datastorage/seafile/seafile-data -F /datastorage/seafile/conf
seafile 1941 0.0 0.0 187036 8160 ? Ss 11:33 0:00 ccnet-server -F /datastorage/seafile/conf -c /datastorage/seafile/ccnet -f /datastorage seafile/logs/ccnet.log -d -P /datastorage/seafile/pids/ccnet.pid
seafile 1943 0.0 0.0 419452 17036 ? Sl 11:33 0:00 /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /datastorage seafile/logs/seafdav.log --pid /datastorage/seafile/pids/seafdav.pid --port 8080 --host localhost
seafile 1944 0.0 0.0 3955540 21928 ? Ssl 11:33 0:00 seaf-server -F /datastorage/seafile/conf -c /datastorage/seafile/ccnet -d /datastorage/seafile/seafile-data -l /datastorage/seafile/logs/seafile.log -P /datastorage/seafile/pids/seaf-server.pid
seafile 2032 0.0 0.1 109784 39784 ? S 11:33 0:00 python2.7 /datastorage/seafile/seafile-server-6.0.4/seahub/manage.py runfcgi host=127.0.0.1 port=8000 pidfile=/datastorage/seafile/seafile-server-6.0.4/runtime/seahub.pid outlog=/datastorage/seafile/seafile-server-6.0.4/runtime/access.log errlog=/datastorage/seafile/seafile-server-6.0.4/runtime/error.log
seafile 2033 0.0 0.1 109784 37772 ? S 11:33 0:00 python2.7 /datastorage/seafile/seafile-server-6.0.4/seahub/manage.py runfcgi host=127.0.0.1 port=8000 pidfile=/datastorage/seafile/seafile-server-6.0.4/runtime/seahub.pid outlog=/datastorage/seafile/seafile-server-6.0.4/runtime/access.log errlog=/datastorage/seafile/seafile-server-6.0.4/runtime/error.log
seafile 2034 0.0 0.1 109784 37768 ? S 11:33 0:00 python2.7 /datastorage/seafile/seafile-server-6.0.4/seahub/manage.py runfcgi host=127.0.0.1 port=8000 pidfile=/datastorage/seafile/seafile-server-6.0.4/runtime/seahub.pid outlog=/datastorage/seafile/seafile-server-6.0.4/runtime/access.log errlog=/datastorage/seafile/seafile-server-6.0.4/runtime/error.log
seafile 2035 0.0 0.1 109784 37756 ? S 11:33 0:00 python2.7 /datastorage/seafile/seafile-server-6.0.4/seahub/manage.py runfcgi host=127.0.0.1 port=8000 pidfile=/datastorage/seafile/seafile-server-6.0.4/runtime/seahub.pid outlog=/datastorage/seafile/seafile-server-6.0.4/runtime/access.log errlog=/datastorage/seafile/seafile-server-6.0.4/runtime/error.log
seafile 2036 0.0 0.1 109784 37768 ? S 11:33 0:00 python2.7 /datastorage/seafile/seafile-server-6.0.4/seahub/manage.py runfcgi host=127.0.0.1 port=8000 pidfile=/datastorage/seafile/seafile-server-6.0.4/runtime/seahub.pid outlog=/datastorage/seafile/seafile-server-6.0.4/runtime/access.log errlog=/datastorage/seafile/seafile-server-6.0.4/runtime/error.log
seafile 2037 0.0 0.1 109784 37768 ? S 11:33 0:00 python2.7 /datastorage/seafile/seafile-server-6.0.4/seahub/manage.py runfcgi host=127.0.0.1 port=8000 pidfile=/datastorage/seafile/seafile-server-6.0.4/runtime/seahub.pid outlog=/datastorage/seafile/seafile-server-6.0.4/runtime/access.log errlog=/datastorage/seafile/seafile-server-6.0.4/runtime/error.log

runtime/error.log和runtime/access.log都是空的。

logs/seafile.init.log最新信息显示:
[05/04/17 11:33:18] …/common/session.c(132): using config file /datastorage/seafile/conf/ccnet.conf
Starting seafile server, please wait …
Seafile server started

Done.

logs/seafile.log最新信息显示:
[05/04/2017 11:33:19 AM] …/common/mq-mgr.c(54): [mq client] mq cilent is started

logs/ccnet.log最新信息显示:
[05/04/17 11:33:18] …/common/session.c(132): using config file /datastorage/seafile/conf/ccnet.conf
[05/04/17 11:33:18] …/common/session.c(455): socket file exists, delete it anyway
[05/04/17 11:33:18] …/common/session.c(484): Listen on /datastorage/seafile/ccnet/ccnet.sock for local clients
[05/04/17 11:33:18] …/common/session.c(290): Update pubinfo file
[05/04/17 11:33:19] …/common/session.c(398): Accepted a local client
[05/04/17 11:33:19] …/common/session.c(398): Accepted a local client
[05/04/17 11:33:19] …/common/session.c(398): Accepted a local client
[05/04/17 11:33:19] …/common/session.c(398): Accepted a local client
[05/04/17 11:33:21] …/common/session.c(398): Accepted a local client
[05/04/17 11:33:21] …/common/peer.c(943): Local peer down

controller.log最新信息显示:
[05/04/17 11:30:33] seafile-controller.c(566): shutting down ccnet-server …
[05/04/17 11:33:18] seafile-controller.c(154): starting ccnet-server …
[05/04/17 11:33:18] seafile-controller.c(73): spawn_process: ccnet-server -F /datastorage/seafile/conf -c /datastorage/seafile/ccnet -f /datastorage/seafile/logs/ccnet.log -d -P /datastorage/seafile/pids/ccnet.pid
[05/04/17 11:33:18] seafile-controller.c(88): spawned ccnet-server, pid 1938
[05/04/17 11:33:19] seafile-controller.c(555): ccnet daemon connected.
[05/04/17 11:33:19] seafile-controller.c(186): starting seaf-server …
[05/04/17 11:33:19] seafile-controller.c(73): spawn_process: seaf-server -F /datastorage/seafile/conf -c /datastorage/seafile/ccnet -d /datastorage/seafile/seafile-data -l /datastorage/seafile/logs/seafile.log -P /datastorage/seafile/pids/seaf-server.pid
[05/04/17 11:33:19] seafile-controller.c(88): spawned seaf-server, pid 1942
[05/04/17 11:33:19] seafile-controller.c(396): pid file /datastorage/seafile/pids/seafdav.pid does not exist
[05/04/17 11:33:19] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /datastorage/seafile/logs/seafdav.log --pid /datastorage/seafile/pids/seafdav.pid --port 8080 --host localhost
[05/04/17 11:33:19] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 1943

logs/seahub.init.log最新信息显示:
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 …

Seahub is started

Done.

重点看 /var/log/nginx.log

/var/log/nginx/error.log的信息如下:
2017/05/04 10:54:10 [notice] 59682#59682: using inherited sockets from “10;11;”
2017/05/04 13:05:48 [error] 1663#1663: *6 “/etc/nginx/html/index.html” is not found (2: No such file or directory), client: 192.168.1.123, server: , request: “GET /? HTTP/2.0”, host: “192.168.1.11”
2017/05/04 13:05:49 [error] 1663#1663: *6 open() “/etc/nginx/html/favicon.ico” failed (2: No such file or directory), client: 192.168.1.123, server: , request: “GET /favicon.ico HTTP/2.0”, host: “192.168.1.1”, referrer: "https://192.168.1.1/?"

请问为什么nginx去访问这里而不是seafile?我该如何解决?

nginx的配置问题吧?

/etc/nginx/conf.d/seafile.conf的配置如下:
server {
listen 80;
server_name “”;
return 301 https://$http_host$request_uri?;
}

server {
listen 443 http2;
server_name “”;

  ssl on;
  ssl_certificate /etc/nginx/ssl/seafile.crt;
  ssl_certificate_key /etc/nginx/ssl/seafile.key;

  location /seafile {
      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   HTTPS               on;
      fastcgi_param   HTTP_SCHEME         https;

      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;
  }
   location /media {
      root /datastorage/seafile/seafile-server-latest/seahub;
  }
 location /seafdav {
    fastcgi_pass    127.0.0.1:8080;
    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   HTTPS               on;

    client_max_body_size 0;

    access_log      /var/log/nginx/seafdav.access.log;
    error_log       /var/log/nginx/seafdav.error.log;
}

}

/var/log/nginx/seahub.access.log和seahub.error.log都是空的

感觉是你这个/etc/nginx/conf.d/seafile.conf的配置 根本没生效~

看看 /etc/nginx.conf 怎么写的

曾生效过,后来系统升过级。
/etc/nginx/nginx.conf里面有一句: include /etc/nginx/conf.d/*.conf;

请教该怎么改才能生效?

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

以上是我的配置,仅供参考。

谢谢:slight_smile: