0

Ghost(ブログプラットフォーム)を実行しているNginx Webサーバーに大量のhtmlファイルと画像ファイルをアップロードしようとしていますghost-blog.com. ghost-blog.com/text.htmlゴーストは完全に正常に動作しますが、さらに、同じドメインの下にある他のファイルとフォルダーを提供したいghost-blog.com/subfolder/index.html.

グーグルで答えを探すのに時間を費やした後、何か「新しい」ものに出くわしたようです。ファイルに変更を加える必要があることは承知してい/etc/nginx/sites-available/defaultます。私が知らないのは、何を追加/編集すればよいかです

  1. /some/random/publicフォルダー publicを作成します
  2. index index.html index.htmこれは、コンテンツ、特にデフォルトファイルを既に提供している Ghost と競合しません。

現在の/etc/nginx/sites-available/default構成ファイルは次のようになります。

server {
  listen 80;
  server_name www.ghost-blog.com;
  rewrite ^/(.*) http://ghost-blog.com/$1 permanent;
}

server {
root /usr/share/nginx/www;
index index.html index.htm;

server_name localhost;

location / {
    try_files $uri $uri/ /index.html;       
  }

location /doc/ {
    alias /usr/share/doc/;
    autoindex on;
    allow 127.0.0.1;
    deny all;
  }
}

/public他のファイルやサブフォルダーを提供するフォルダーを作成する方法について何か提案はありますか?

4

1 に答える 1