1

Owncloud がインストールされ、ネットワーク上で Nginx を実行しています。LAN の外から自分のクラウドにアクセスできます。LAN だけでLionwikiをホストしたいと考えています。

/etc/nginx/sites-enabled/ローカル ネットワーク上の特定のディレクトリのみを提供するために、新しい構成ファイルを追加したいと考えています。

私の現在の設定:

$ cat /etc/nginx/sites-enabled/default 
# owncloud (ssl/tls)
server {
  listen 443 ssl;
  server_name 192.168.1.10;
  ssl_certificate /etc/nginx/cert.pem;
  ssl_certificate_key /etc/nginx/cert.key;
  root /var/www;
  index index.php;
  client_max_body_size 1000M; # set maximum upload size
  fastcgi_buffers 64 4K;

  # deny direct access
  location ~ ^/owncloud/(data|config|\.ht|db_structure\.xml|README) {
    deny all;
  }

  # default try order
  location / {
    try_files $uri $uri/ index.php;
  }

  # owncloud WebDAV
  location @webdav {
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS on;
    include fastcgi_params;
  }

  # enable php
  location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
    try_files $script_name = 404;
    include fastcgi_params;
    fastcgi_param PATH_INFO $path_info;
    fastcgi_param HTTPS on;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_read_timeout 900s; # 15 minutes
  }
}    
4

1 に答える 1

1

nginx セットアップ用に 2 つの「ホスティング パッケージ」をセットアップします。自分のクラウドのパブリック ホスト名をリッスンするものと、内部ホスト名および/または内部 IP をリッスンするものです。次に、http://the-host-name-you-have.chosenを介して Owncloud にアクセスし、 \SERVERNAME または内部 IP (例: 192.168.0.3) を介して wiki にアクセスできます。

設定は次のようになります。

server {
            listen       80;
            server_name  SERVERNAME;

            access_log  logs/localhost.access.log  main;

            location / {
                root /var/www/lionwiki;
                index index.html index.htm index.php;
            }

            listen       80;
            server_name  public-host-name;

            access_log  logs/localhost.access.log  main;

            location / {
                root /var/www/owncloud;
                index index.html index.htm index.php;
            }
       }

注: その構文が正しいかどうかは 100% 確信が持てません。通常は IIS を使用しています。

于 2014-10-28T15:48:32.120 に答える