異なる権限を持つnginxを使用してデフォルトディレクトリからサブディレクトリを提供する

異なる権限を持つnginxを使用してデフォルトディレクトリからサブディレクトリを提供する

これは現在403エラーを返すnginxの関連フラグメントです。

   location /specialoutput/ {
      limit_req zone=mylimit burst=20 nodelay;
      root /data/customUser/outputFiles/customApp/csv/;
      index index.html index.htm
      autoindex on;
   }

csvサブフォルダには次の権限があります。

drwxr-xr-x 12 customUser customUser  289 Apr  9 19:17 csv

なぜ403 Forbiddenエラーが発生し続けるのですか?この問題を解決する方法はありますか?

ありがとうございます!

ベストアンサー1

httpエラー403は次のことを意味します。

The HTTP server understood the request, but is refusing to fulfill it.
This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable (for example the server is an Intranet and only the LAN machines are authorized to connect).

私はngixを知りませんが、親ディレクトリが少なくともngixにサーバープロセス(私の意見ではcustomUser)にサブディレクトリへの読み取りおよびクロール権限を与えるように要求することを確認します。

CSVディレクトリのファイルは、同じnginxプロセスから読み取ることができなければなりません。

おすすめ記事