我在 Raspberry Pi 上运行着带有 Nginx 的 Seafile。
现在我想知道如何实现以下 URL 结构(所有内容都在 HTTPS 上,端口 443):
https://example.com/seafile Seafile Webinterface
https://example.com/raspcontrol Raspcontrol Webinterface
在根文件夹中应该有一个简单的 HTML 文件,其中包含 Seafile 和 Raspcontrol 的 URL。
这是我的default
配置/etc/nginx/sites-available/
:
server {
root /usr/share/nginx/www;
index index.php index.html;
server_name localhost;
location / {
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
这是我的seahub
配置/etc/nginx/sites-available/
:
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/seahub.crt;
ssl_certificate_key /etc/nginx/ssl/seahub.key;
server_name example.com;
error_page 497 https://$host:$server_port$request_uri;
client_max_body_size 10G;
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 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 /home/seafile/seafile-server-latest/seahub;
}
}