开启了一个seafile服务,用的是 https://cloud.seafile.com/published/seafile-manual-cn/docker/%E7%94%A8Docker%E9%83%A8%E7%BD%B2Seafile.md ,端口映射为 8888:80 ,nginx中设置为:
server {
listen 80;
server_name IP地址;
location / {
root /root/static/;
autoindex on;
}
}
server {
listen 80;
server_name file.xxxx.top;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name file.xxxx.top;
ssl_certificate /root/nginx/cert/file.xxxx.top.pem;
ssl_certificate_key /root/nginx/cert/file.xxxx.top.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
index index.php index.html index.htm;
location / {
proxy_pass http://127.0.0.1:8888;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
这样就可以用file.xxxx.top访问了,同时还有一个静态文件目录