2

У меня есть Seafile с Nginx, работающим на Raspberry Pi.

Теперь я хочу знать, как реализовать следующую структуру URL (все на HTTPS, порт 443):

https://example.com/seafile           Seafile Webinterface
https://example.com/raspcontrol       Raspcontrol Webinterface

В корневой папке должен быть простой HTML-файл с URL-адресами Seafile и Raspcontrol.

Вот моя конфигурация по 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 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;
}
}

0