PrestaShop + Nginx

PrestaShop Nginx Congiguration

Adminディレクトリ(sub directory:store) はフォルダ名を変更して、Nginxの設定にも反映させること。

# [REQUIRED EDIT] Change this block to your admin folder
    location /store/your-admin/ {
        if (!-e $request_filename) {
            rewrite ^/store/.*$ /store/your-admin/index.php last;
        }
    }

php-fpmセクション(sub directory:store) は以下の様に変更(Dockerコンテナphp-fpm指定)。

location ~ \.php$ {
		# Verify that the file exists, redirect to index if not
		#try_files $fastcgi_script_name /index.php$uri&$args =404;
		
		alias /$1;
		
		include fastcgi_params;
		fastcgi_index index.php;

		fastcgi_split_path_info ^\/store\/(.+\.php)(.*)$;
		# fastcgi_param  HTTPS 'on';

		fastcgi_param PATH_INFO       $fastcgi_path_info;
		fastcgi_param PATH_TRANSLATED $fastcgi_path_info;
		fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;

		fastcgi_pass prestashop-fpm:9000;

		fastcgi_keep_conn on;
		fastcgi_connect_timeout 10s;
		fastcgi_read_timeout 30s;
		fastcgi_send_timeout 30s;

		# In case of long loading or 502 / 504 errors
		fastcgi_buffer_size 256k;
		fastcgi_buffers 256 16k;
		fastcgi_busy_buffers_size 256k;
		client_max_body_size 10m;
	}

PrestaShop(1.7.6.5)をNginxのSSL対応後にインストールしたため、以下リダイレクトエラー発生

err_too_many_redirects

Prestashopデータベースに直接アクセスし、configrationテーブルのPS_SSL_ENABLEDPS_SSL_ENABLED_EVERYWHEREの値を “1” に書換えます。