Jump to content

'undefined' error when selecting a product combination - NGINX? (works ok with Apache)


EmilioJ

Recommended Posts

Hi there!

I am trying to migrate from Apache to NGINX, and everything seems to work Ok except for product combinations. I've tried different NGINX configurations with the same result:

- the 'official': https://devdocs.prestashop.com/1.7/basics/installation/nginx/

- this alternative: https://acinonyxweb.agency/servers/optimal-nginx-configuration-for-prestashop-1-7

- some other I found in this forum

In all cases I got an 'undefined' message when selecting something in the dropdown box of a product combination.

I installed the last prestashop version (1.7.8.6) from scratch and the issue is still there (I also tried this last installation with apache2 and works flawlessly). You can see what I mean if you select a different size or a different color for this product in this vanilla PS 1.7.8.6:

https://psvanilla.xestr.eu/en/men/1-2-hummingbird-printed-t-shirt.html

I have no previous experience with NGINX, and I can not see significant messages in the log (even enable debug mode in PS).

Any ideas?

I found this thread in the forum, with apparently the same behavior, but I am not using any external module in my proof of concept with an out-of-the-box PS installation:

Edited by EmilioJ
Fix URL (see edit history)
Link to comment
Share on other sites

Solved! (I think)

Finally the problem was that I needed the language in URL rewrite, since I was using that in PS. This did the trick for the vanilla installation:
 

server {
[...]
    rewrite ^/en$ /en/ redirect;
    rewrite ^/en/(.*) /$1;
[...]
}

 

  • Like 2
Link to comment
Share on other sites

Please suggest me I added nginx rewrite rule for multistore . i added rewrite rule but product images are not showing

        location /store-1/ {
          rewrite ^/store-1/(.*)$ /$1 last;
          try_files $uri $uri/ /index.php$is_args$args;
        }

        location /store-2/ {
          rewrite ^/store-2/(.*)$ /$1 last;
          try_files $uri $uri/ /index.php?$args;
        }
 

Edited by ashish.kpaul (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...