web-dev-qa-db-ja.com

AdministratorのNginx 502

JoomlaのインストールをDigitalOceanに転送したところ、nginxで実行しています。サイトは正常に動作しているようですが、管理者部分にログインしてグローバル構成の何かを更新しようとすると、次のエラーが発生します。

2014/06/26 10:08:38 [error] 19654#0: *1035 FastCGI sent in stderr: "PHP message: PHP Warning:
file_put_contents(/usr/share/nginx/projects/hoopsforu/configuration.php): failed to open stream
: Permission denied in /usr/share/nginx/projects/hoopsforu/libraries/joomla/filesystem/file.php
 on line 426" while reading response header from upstream, client: 70.208.86.53, server: hoopsf
oru.com, request: "POST /administrator/index.php?option=com_config HTTP/1.1", upstream: "fastcg
i://127.0.0.1:9000", Host: "hoopsforu.com", referrer: "http://hoopsforu.com/administrator/index
.php?option=com_config"
2014/06/26 10:08:38 [error] 19654#0: *1035 upstream sent invalid status "0 Could not write to t
he configuration file" while reading response header from upstream, client: 70.208.86.53, serve
r: hoopsforu.com, request: "POST /administrator/index.php?option=com_config HTTP/1.1", upstream
: "fastcgi://127.0.0.1:9000", Host: "hoopsforu.com", referrer: "http://hoopsforu.com/administra
tor/index.php?option=com_config"

これは私の構成は次のようになります:

server {
    listen 80;
    server_name  hoopsforu.com www.hoopsforu.com;
    server_name_in_redirect off;

    root           /usr/share/nginx/projects/hoopsforu;
        index index.php index.html index.htm default.html default.htm;
        # Support Clean (aka Search Engine Friendly) URLs
        location / {
                        try_files $uri $uri/ /index.php?$args;
        }

        # deny running scripts inside writable directories
        location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
                        return 403;
                        error_page 403 /403_error.html;
        }

        location ~ \.php$ {
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi.conf;
        }

        # caching of files
        location ~* \.(ico|pdf|flv)$ {
                        expires 1y;
        }

        location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
                        expires 14d;
        }
}
4
hanleyhansen

ファイルとフォルダのアクセス許可がそれぞれ644と755に設定されていることを確認してください。権限の詳細については、こちらをご覧ください: https://joomla.stackexchange.com/a/133/19

また、ユーザーまたはグループがnginxに設定されていることを確認して、nginxがそれらのファイル/ディレクトリへの書き込み権限を持つようにします。

4
ContextSwitch