jhd Posted October 12, 2017 Share Posted October 12, 2017 Hello, I haved migrated one shop from Apache to Nginx 1.10.3, and installed other fresh PS installation 1.7.2.2. Both works but not works catalog/modules and catalog/products, I get error 404 and error 500 nginx. In migrated installation I get this in Improve>>Modules>>Modules&Services: 2017/10/12 10:06:48 [error] 4995#4995: *7139 open() "/var/www/domain.com/web/backoffice/index.php/module/catalog" failed (20: Not a directory), client: 88.35.140.207, server: domain.com, request: "GET /backoffice/index.php/module/catalog?_token=ZxOuMFjapeIHCIYTq976LX7-410oxMPrdcsN6pM-0_8 HTTP/1.1", host: "domain.com", referrer: "http://domain.com/backoffice/index.php?controller=AdminInformation&token=862f7299fgb9db5fdb825441ed8e4cf0" I get this in Sell>>Catalog>>Products 2017/10/12 10:11:25 [error] 4995#4995: *7229 open() "/var/www/domain.com/web/backoffice/index.php/product/catalog" failed (20: Not a directory), client: 88.35.140.207, server: domain.com, request: "GET /backoffice/index.php/product/catalog?_token=y1SX50YC5iuonZ9VgsI4Fq_jdla-_jw7TtuYRTllUQs HTTP/1.1", host: "domain.com", referrer: "http://domain.com/backoffice/index.php?controller=AdminOrders&token=016a2b9b56894bf971c0f88a9b97a7bdc" In Fresh Installation Improve>>Modules>>Modules&Service 2017/10/12 10:14:23 [error] 4996#4996: *7272 rewrite or internal redirection cycle while internally redirecting to "/error/404.html", client: 88.35.140.207, server: otherdomain.com, request: "GET /favicon.ico HTTP/1.1", host: "otherdomain.com", referrer: "http://otherdomain.com/backoffice/index.php/module/catalog?_token=ouxt_7zK2gsDNg3uZyQLyLRw5DT9vXsy4QWX8eFaCjQ" Sell>>Catalog>>Products 2017/10/12 10:17:36 [error] 4996#4996: *7320 rewrite or internal redirection cycle while internally redirecting to "/error/404.html", client: 88.35.140.207, server: otherdomain.com, request: "GET /favicon.ico HTTP/1.1", host: "otherdomain.com", referrer: "http://otherdomain.com/backoffice/index.php/product/catalog?_token=ouxt_7zK2gsDNg3uZyQLyLRw5DT9vXsy4QWX8eFaCjQ" Do you have any idea what the problem might be? Best regards. Directives to the first domain (migrated PS installation) PHP INI register_globals = off; magic_quotes_gpc = off; allow_url_fopen = true; allow_url_include = on; upload_max_filesize = 50M; post_max_size = 50M; memory_limit = 1024M; max_execution_time = 3000; max_input_time = 3000; max_input_vars = 10000; suhosin.get.max_vars = 10000; suhosin.post.max_vars = 10000; Nginx Directives client_header_timeout 3000; client_body_timeout 3000; fastcgi_read_timeout 3000; client_max_body_size 32m; fastcgi_buffers 8 128k; fastcgi_buffer_size 128k; Link to comment Share on other sites More sharing options...
spaetz Posted October 12, 2017 Share Posted October 12, 2017 Hi there, it takes some tweaking with nginx bit it works. Do check out the sample nginx.configuration file at: https://github.com/MattLoyeD/Prestashop-Nginx The main issue is that it uses /adminXXX/index.php/product/... urls and those need to be directed to adminXXX/index.php?... P.S. If you build on that add "attribute" and "feature" to the list of modules in that list of symfony names as well, as they are needed but currently missing. 1 Link to comment Share on other sites More sharing options...
jhd Posted October 12, 2017 Author Share Posted October 12, 2017 (edited) Thank you! Now works better, I can access to Products, but in Modules and Services i get the curl error: Cannot get catalog data, please try again later. Reason: cURL error 28: Resolving timed out after 5515 milliseconds 2017/10/12 16:35:18 [error] 2839#2839: *1 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/backoffice/index.php/_wdt/3d61c5&_token=ouxt_7zK1gsDNg6uZyQLyLRw7DT9vXsy3QWX8eFaCjQ&&&&&&&&&&", client: 81.38.120.101, server: domain.com; request: "GET /backoffice/index.php/_wdt/3d61c5?_token=ouxt_6xK1gsDNg6uZyQLyLRw7DT9vXsy3QWX8eGhCjQ HTTP/1.1", host: "domain.com", referrer: "http://domain.com/backoffice/index.php/module/catalog?_token=ouxt_6xK1gsDNg6uZyQLyLRw7DT9vXsy3QWX8eGhCjQ" Something must be wrong, it is not normal: /index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/backoffice/index.php This is the configuration that I have left after adding the directives to IspConfig. server { listen *:80; server_name mydomain.com www.mydomain.com; root /var/www/mydomain.com/web/; index index.html index.htm index.php index.cgi index.pl index.xhtml; error_page 400 /error/400.html; error_page 401 /error/401.html; error_page 403 /error/403.html; error_page 404 /error/404.html; error_page 405 /error/405.html; error_page 500 /error/500.html; error_page 502 /error/502.html; error_page 503 /error/503.html; recursive_error_pages on; location = /error/400.html { internal; } location = /error/401.html { internal; } location = /error/403.html { internal; } location = /error/404.html { internal; } location = /error/405.html { internal; } location = /error/500.html { internal; } location = /error/502.html { internal; } location = /error/503.html { internal; } error_log /var/log/ispconfig/httpd/mydomain.com/error.log; access_log /var/log/ispconfig/httpd/mydomain.com/access.log combined; location ~ /\. { deny all; } location ^~ /.well-known/acme-challenge/ { access_log off; log_not_found off; root /usr/local/ispconfig/interface/acme/; autoindex off; index index.html; try_files $uri $uri/ =404; } location = /favicon.ico { log_not_found off; access_log off; expires max; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } location = /robots.txt { allow all; log_not_found off; access_log off; } location /stats/ { index index.html index.php; auth_basic "Members Only"; auth_basic_user_file /var/www/clients/client1/web3/web/stats/.htpasswd_stats; } location ^~ /awstats-icon { alias /usr/share/awstats/icon; } location ~ \.php$ { try_files /bbcb1825da9ba291916faeeab4c17096.htm @php; } location @php { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/lib/php7.0-fpm/web3.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } location /cgi-bin/ { try_files $uri =404; include /etc/nginx/fastcgi_params; root /var/www/clients/client1/web3; gzip off; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } error_page 404 /index.php?controller=404; rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last; rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; location / { try_files $uri $uri/ /index.php$uri&$args; } location ~ /(international|_profiler|module|product|combination|specific-price)/(.*)$ { try_files $uri $uri/ /index.php?q=$uri&$args /backoffice/index.php$is_args$args; } location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include /etc/nginx/fastcgi_params; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; } } Edited October 12, 2017 by jhd (see edit history) Link to comment Share on other sites More sharing options...
jhd Posted October 15, 2017 Author Share Posted October 15, 2017 (edited) Hello, Already solved for the both domains. Until an hour ago the modules could be managed without problems but now I'm getting this error: Cannot get catalog data, please try again later. Reason: cURL error 28: Resolving timed out after 5514 milliseconds PHP allow_url_fopen = true; upload_max_filesize = 30M; post_max_size = 30M; memory_limit = 512M; max_execution_time = 300; max_input_time = 300; max_input_vars = 300; register_globals = Off magic_quotes_gpc = Off allow_url_include = Off safe_mode = Off safe_mode_gid = Off NGINX # Gzip Settings, convert all types. gzip on; gzip_vary on; gzip_proxied any; # Can be enhance to 5, but it can slow you server # gzip_comp_level 5; # gzip_min_length 256; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; # Supposed to be the case but we never know # text/html; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; error_page 404 /index.php?controller=404; rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last; rewrite ^/c/([a-zA-Z-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1.jpg last; rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last; try_files $uri $uri/ /index.php?$args; location ~ /(international|_profiler|module|product|combination|specific-price|feature|attribute)/(.*)$ { try_files $uri $uri/ /index.php?q=$uri&$args /adminXXXX/index.php$is_args$args; } PHP-FMP pm = dynamic pm.max_children = 75 pm.start_servers = 10 pm.min_spare_servers = 5 pm.max_spare_servers = 20 pm.max_requests = 300 Edited October 15, 2017 by jhd (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now