nginx配置反向代理,8000端口成功,8082端口失败

小白求问大佬们,如何把默认的8000和8082端口去掉
根据大神在这个帖子里的解答,

我按照 https://manual-cn.seafile.com/deploy/deploy_with_nginx.html 上面写的一步一步操作,到这一步的时候:

service_url可以把8000端口去掉了,可以直接访问,但是文件下载链接如果按照手册改成./seafhttp,就会转至seahub/404.html。
这个是什么情况呢?算半个小白,没把反向代理弄明白,希望大神能告知一下是哪里出了问题。

web 反代检查清单

  1. 是否关闭 SELinux (或正确配置 SELinux)方法:https://bbs.seafile.com/t/seafile-centos7-selinux/1452
  2. nginx 配置是否正确(域名或者 ip 是否正确;location /media 的路径是否正确)
  3. nginx 是否已经起来(systemctl status nginx)
  4. seahub.sh 是否以 fastcgi 方式启动。

最后,出现问题可以检查 seafile 目录的 logs 目录下 seahub_django_request.log 这个日志文件。

nginx 的日志可以检查 /var/log/nginx 下的 seahub.error.log

1 个赞

您好,按照你的检查清单,我操作的结果如下:
1.SELinux is disabled
2.和4.我放在一起说:如图:

如果以 fastcgi 方式启动,访问 seafile.xxx.com 显示 502;
如果以普通方式启动,则可以正常访问 seafile.xxx.com,同时也可以正常访问 xxx.com:8000
3.Active: active (running)

请提供 seafile 目录的 logs 目录下 seahub_django_request.log 这个日志文件

还有 /var/log/nginx 下的 seahub.error.log

seahub.error.log内容为空;
seahub_django_request.log内容如下:

  2017-04-14 10:00:46,485 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /accounts/register/
Traceback (most recent call last):
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/registration/views.py", line 197, in register
    new_user = backend.register(request, **form.cleaned_data)
  File "/opt/seafile/seafile-server-6.0.9/seahub/seahub/base/accounts.py", line 478, in register
    send_email=config.REGISTRATION_SEND_MAIL)
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/registration/models.py", line 93, in create_inactive_user
    send_email, is_active=False)
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/registration/models.py", line 85, in create_email_user
    registration_profile.send_activation_email(site)
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/registration/models.py", line 285, in send_activation_email
    ctx_dict, None, [user.username])
  File "/opt/seafile/seafile-server-6.0.9/seahub/seahub/utils/__init__.py", line 755, in send_html_email
    msg.send()
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/core/mail/message.py", line 303, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/core/mail/backends/smtp.py", line 100, in send_messages
    new_conn_created = self.open()
  File "/opt/seafile/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/core/mail/backends/smtp.py", line 67, in open
    self.connection.login(self.username, self.password)
  File "/usr/lib64/python2.7/smtplib.py", line 621, in login
    raise SMTPAuthenticationError(code, resp)
SMTPAuthenticationError: (535, 'Incorrect authentication data')
2017-04-14 10:00:46,745 [WARNING] django.request:170 get_response Not Found: /favicon.ico
2017-04-14 11:08:25,079 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 11:21:36,089 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-14 11:26:58,121 [WARNING] django.request:170 get_response Not Found: /logo.ico
2017-04-14 11:47:38,095 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 11:47:59,505 [WARNING] django.request:170 get_response Not Found: /demo.css
2017-04-14 11:47:59,586 [WARNING] django.request:170 get_response Not Found: /back.jpg
2017-04-14 11:50:38,442 [WARNING] django.request:170 get_response Not Found: /Cloud/f/25822410e7/
2017-04-14 11:53:03,282 [WARNING] django.request:170 get_response Not Found: /Cloud/f/25822410e7/
2017-04-14 12:16:14,107 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 13:09:35,978 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 13:43:22,118 [WARNING] django.request:170 get_response Not Found: /seafile
2017-04-14 13:48:31,164 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 13:57:05,110 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 13:57:11,341 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 14:19:22,179 [WARNING] django.request:170 get_response Not Found: /cloud
2017-04-14 14:21:13,120 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 14:22:01,089 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-14 14:24:41,266 [WARNING] django.request:170 get_response Not Found: /404/search_children.js
2017-04-14 14:26:26,875 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 14:26:36,176 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 14:55:20,059 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 14:56:55,142 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 15:30:01,083 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 15:31:12,048 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 15:31:21,088 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 16:20:21,305 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 16:22:57,169 [WARNING] django.request:170 get_response Not Found: /cloud
2017-04-14 16:26:01,159 [WARNING] django.request:170 get_response Not Found: /api2/accounts/xiaoluzi123456%40vip.qq.com
2017-04-14 16:27:26,126 [WARNING] django.request:170 get_response Not Found: /seafile
2017-04-14 16:34:42,097 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 16:42:23,096 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-14 17:12:10,185 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 17:12:22,787 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 17:13:45,041 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 17:13:54,085 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 17:26:01,525 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 17:26:10,081 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 17:32:52,152 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 17:54:15,073 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 18:05:11,615 [WARNING] django.request:170 get_response Not Found: /seafhttp/files/e08b2294-8279-4255-a15f-e899675fdd6b/第六届校团委学生会主席团通讯录.xls
2017-04-14 18:12:35,598 [WARNING] django.request:170 get_response Not Found: /favicon.ico
2017-04-14 18:14:29,085 [WARNING] django.request:170 get_response Not Found: /favicon.ico
2017-04-14 19:01:34,191 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-14 19:01:53,138 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-14 19:38:55,274 [WARNING] django.request:170 get_response Not Found: /api2/accounts/xiaoluzi123456%2540vip.qq.com
2017-04-14 19:39:04,220 [WARNING] django.request:170 get_response Not Found: /api2/accounts/xiaoluzi123456%2540vip.qq.com
2017-04-14 19:52:04,108 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 19:58:17,122 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 20:04:30,103 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:04:30,131 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:04:30,164 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:04:30,175 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:05:19,167 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 20:06:05,483 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:06:15,119 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:25:25,275 [WARNING] django.request:170 get_response Not Found: /f/25822410e7/
2017-04-14 20:25:34,210 [WARNING] django.request:170 get_response Not Found: /f/25822410e7/
2017-04-14 20:27:31,126 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:36:15,613 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 20:36:25,066 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 20:47:05,643 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:47:14,150 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 20:51:08,090 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 20:59:30,033 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 20:59:38,132 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 20:59:38,146 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 20:59:38,178 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 20:59:38,199 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 21:01:20,130 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-14 21:10:57,089 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 21:33:04,801 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 21:33:14,113 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 21:51:49,197 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 22:01:42,954 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 22:01:52,215 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 22:03:40,124 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-14 22:08:48,104 [WARNING] django.request:170 get_response Not Found: /api2/accounts/xiaoluzi123456%252540vip.qq.com
2017-04-14 22:35:16,169 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 22:41:07,183 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 22:41:22,088 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 22:44:24,213 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-14 22:45:09,108 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-14 22:59:33,345 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 22:59:42,150 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-14 23:06:35,078 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-15 00:00:09,582 [WARNING] django.request:170 get_response Not Found: /cache/global/img/gs.gif
2017-04-15 00:01:44,113 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-15 00:07:16,087 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-15 00:07:42,601 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-15 00:13:25,173 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-15 00:13:25,183 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 00:15:35,072 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 00:21:28,229 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 00:29:24,915 [WARNING] django.request:170 get_response Not Found: /recordings/index.php
2017-04-16 00:31:21,199 [WARNING] django.request:170 get_response Not Found: /ajax/lib/e6de32a2-f31a-4f5c-81ec-f14e288da379/dir/
2017-04-16 00:53:22,115 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 01:24:51,173 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 01:49:39,047 [WARNING] django.request:170 get_response Not Found: /ajax/repo/2588adcb-795d-4157-a171-829d44c3037b/file_op_url/
2017-04-16 01:49:48,169 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-16 01:49:48,195 [WARNING] django.request:170 get_response Not Found: /ajax/repo/2588adcb-795d-4157-a171-829d44c3037b/file_op_url/
2017-04-16 02:08:33,191 [WARNING] django.request:170 get_response Not Found: /f/2130833673/
2017-04-16 02:28:44,411 [WARNING] django.request:170 get_response Not Found: /cache/global/img/gs.gif
2017-04-16 02:43:49,163 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-16 02:44:29,217 [WARNING] django.request:170 get_response Not Found: /ajax/lib/e6de32a2-f31a-4f5c-81ec-f14e288da379/dir/
2017-04-16 02:57:00,239 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-16 02:57:08,176 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-16 03:24:53,082 [WARNING] django.request:170 get_response Not Found: /recordings/index.php
2017-04-16 03:36:45,678 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 03:36:55,086 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 03:43:01,125 [WARNING] django.request:170 get_response Not Found: /ajax/repo/2588adcb-795d-4157-a171-829d44c3037b/file_op_url/
2017-04-16 04:10:31,225 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 04:18:17,987 [WARNING] django.request:170 get_response Not Found: /cache/global/img/gs.gif
2017-04-16 04:32:58,211 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 04:35:47,256 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 04:35:55,152 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 05:09:58,115 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-16 05:24:17,193 [WARNING] django.request:170 get_response Not Found: /ajax/lib/e6de32a2-f31a-4f5c-81ec-f14e288da379/dir/
2017-04-16 07:16:44,353 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 07:16:52,103 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 07:20:37,144 [WARNING] django.request:170 get_response Not Found: /f/2130833673/
2017-04-16 07:57:02,269 [WARNING] django.request:170 get_response Not Found: /ajax/lib/e6de32a2-f31a-4f5c-81ec-f14e288da379/dir/
2017-04-16 08:00:51,243 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-16 08:32:01,083 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 08:32:01,116 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 08:32:01,128 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 08:32:01,189 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 09:30:42,366 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 09:30:49,188 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 09:31:04,505 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 09:37:19,278 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 10:15:00,213 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 12:06:31,165 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 12:15:06,157 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 14:27:59,166 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 15:08:19,107 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 15:36:54,144 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 17:19:40,118 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 18:01:57,165 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 18:02:04,234 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 19:22:34,967 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 19:22:44,079 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 20:16:55,096 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 20:28:48,145 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 20:29:05,166 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-16 20:29:29,395 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-16 20:31:41,195 [WARNING] django.request:170 get_response Not Found: /ajax/get_popup_notices/
2017-04-16 21:12:54,301 [WARNING] django.request:170 get_response Not Found: /d/6bc1ab763a/
2017-04-16 21:23:27,961 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 21:23:37,184 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-16 21:50:35,136 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 21:59:30,107 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 22:37:42,675 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-16 22:37:51,269 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-16 22:40:09,108 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 22:49:30,884 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-16 22:49:39,181 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-16 23:22:28,980 [WARNING] django.request:170 get_response Not Found: /cache/global/img/gs.gif
2017-04-16 23:29:55,961 [WARNING] django.request:170 get_response Not Found: /ajax/lib/e6de32a2-f31a-4f5c-81ec-f14e288da379/dir/
2017-04-16 23:36:05,159 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 23:36:28,073 [WARNING] django.request:170 get_response Not Found: /recordings/index.php
2017-04-16 23:37:22,143 [WARNING] django.request:170 get_response Not Found: /f/2130833673/
2017-04-16 23:37:39,120 [WARNING] django.request:170 get_response Not Found: /f/2130833673/
2017-04-16 23:43:53,180 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-16 23:44:09,509 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-17 00:00:55,154 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-17 00:35:10,177 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-17 00:55:35,185 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-17 00:56:03,085 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-17 00:57:44,745 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-17 01:08:13,904 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-17 01:08:23,318 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-17 01:26:11,585 [WARNING] django.request:170 get_response Not Found: /cache/global/img/gs.gif
2017-04-17 01:29:50,328 [WARNING] django.request:170 get_response Not Found: /ajax/repo/2588adcb-795d-4157-a171-829d44c3037b/file_op_url/
2017-04-17 01:43:29,146 [WARNING] django.request:170 get_response Not Found: /ajax/lib/e6de32a2-f31a-4f5c-81ec-f14e288da379/dir/
2017-04-17 02:01:44,399 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-17 02:39:34,271 [WARNING] django.request:170 get_response Not Found: /d/b921e49a13/
2017-04-17 02:39:34,533 [WARNING] django.request:170 get_response Not Found: /d/b921e49a13/
2017-04-17 02:39:35,274 [WARNING] django.request:170 get_response Not Found: /d/b921e49a13/
2017-04-17 02:39:43,113 [WARNING] django.request:170 get_response Not Found: /d/b921e49a13/
2017-04-17 02:39:48,908 [WARNING] django.request:170 get_response Not Found: /d/b921e49a13/
2017-04-17 02:39:49,109 [WARNING] django.request:170 get_response Not Found: /d/b921e49a13/
2017-04-17 02:39:58,146 [WARNING] django.request:170 get_response Not Found: /d/b921e49a13/
2017-04-17 02:57:23,136 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-17 02:57:30,173 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/
2017-04-17 03:06:41,313 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-17 03:18:31,112 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-17 03:50:02,145 [WARNING] django.request:170 get_response Not Found: /ajax/lib/6ffb274e-3bff-44ce-90f2-8dadf92eaf99/dir/
2017-04-17 03:50:48,155 [WARNING] django.request:170 get_response Not Found: /ajax/unseen-notices-count/
2017-04-17 04:03:57,805 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-17 04:04:13,712 [WARNING] django.request:170 get_response Not Found: /ajax/lib/2588adcb-795d-4157-a171-829d44c3037b/dir/
2017-04-17 04:14:28,638 [WARNING] django.request:170 get_response Not Found: /d/6bc1ab763a/
2017-04-17 04:25:49,090 [WARNING] django.request:170 get_response Not Found: /ajax/repo/2588adcb-795d-4157-a171-829d44c3037b/file_op_url/
2017-04-17 05:26:57,280 [WARNING] django.request:170 get_response Not Found: /ajax/space_and_traffic/

将 seahub 和 seahub-data 设置成其他用户组可读
chmod +r ${seafile_dir}/seafile-server-latest/seahub
chmod +r ${seafile_dir}/seahub-data

${seafile_dir} 指 seafile 的程序目录。

谢谢指导,但是我按照你说的,
chmod +r /opt/seafile/seafile-server-latest/seahub
chmod +r /opt/seafile/seahub-data
运行了这两条指令后,再运行./seahub.sh restart-fastcgi,仍然提示502,运行./seahub.sh restart后可正常访问。
请问如果您需要进一步了解原因,还需要我提供什么吗?服务器密码也可以QAQ

有没有检查过 nginx 的配置文件是否正确?

将 nginx 的配置贴上来看看。

我指的是 Seafile 的 nginx 配置。

首先先感谢您!然后我把三个我改动过、与seafile相关的配置复制上来,一共有三个,根目录都在/etc/nginx文件夹里,域名我都隐去了QAQ

(第一个) ./nginx.conf

#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/


user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

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

proxy_cache_path /tmp/cache levels=1:2 keys_zone=cache:60m max_size=1G;

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

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

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

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

server {
        listen       80 default_server;
        listen       [::]:80 default_server;
    server_name cloud.和谐和谐.cn; #绑定域名
    index index.htm index.html index.php; #默认文件
    root /home; #网站根目录
}


    server {
        listen       80;
        listen       [::]:80;
        server_name  和谐和谐.cn;
        root         /home;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

                 location ~* \.(html|css|jpg|png|jpeg|bmp|swf|gif|ico|js)$ {
                        proxy_cache          cache;
                        proxy_cache_key      $host$uri$is_args$args;
                        proxy_cache_valid    200 301 302 30d;
                        expires              30d;
                        access_log off;
                        root /home;
                        break;

        }
    }

(第二个) **./con.d/seafile.conf**:
server {
    listen 80;
    server_name cloud.和谐和谐.cn;

    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;
    }

    location /media {
        root /opt/seafile/seafile-server-latest/seahub;
    }
}

(第三个) **./conf.d/reverse-proxy.conf**:
`server { listen 80; server_name cloud.和谐和谐.cn; location / { proxy_redirect off; 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_pass http://和谐和谐.cn:8000; } }`

这个是干嘛的?貌似官方文档没要求配置这个吧?

这个是文件夹里本来存在的,我把其中的example.com改成了我的域名:8000。
seafile.conf是我新建的,原本不存在。

尝试把这个去掉,或者移出配置目录

删除后以fastcgi启动,仍然显示502。
此时原网站xxx.com:8000也无法访问,显示网站无响应

经过Nero大神指点,原因为nginx.conf与seafile.conf设置冲突,将nginx.conf中的server删去、添上include ./conf.d后,在conf.d中创建一个新的conf后写上被删去的server语句,加上listen 80 default_server;后,重启nginx完美解决,再次感谢Nero活雷锋!

1 个赞

这个反代看着头大啊。。看了几天了还蒙圈呢