cancel
Showing results for 
Search instead for 
Did you mean: 

NGINX error after deploying SSR Spartacus code in CCV2

santhusds
Member
0 Kudos

Hi Experts,

I am trying to deploy SSR Spartacus code in Hybris CCV2. the code works perfectly in local but after it is deployed in CCV2, i can only access the site using https://example.com/index.html. I get below error in the log when i try to access the site using https://example.com or https://example.com/powertools-spa/en/USD/.

Error 1:

"log": "2023/11/09 14:25:15 [error] 15#15: *42641 connect() failed (111: Connection refused) while connecting to upstream, client: 10.244.0.60, server: ~^.my-app.$, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:4200/", host: "example.com"",

Error 2:

"log": "2023/11/09 14:25:15 [error] 15#15: *42641 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 10.244.0.60, server: ~^.my-app.$, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:4200/", host: "example.com"",

Please help me resolve this problem.

Accepted Solutions (0)

Answers (1)

Answers (1)

cristiano-costa
Advisor
Advisor
0 Kudos

Hello,
Hope you are doing well.

The problem might be how the JS Storefront manifest file is configured. If you are using client side rendering you must follow the example below and point the webroot to where index.html file is located, just like below:

   {
      "name": "myApp",
      "path": "myApp",
      "ssr": {
        "enabled": true,
        "path": "dist/myApp/server/main.js"
      },
      "csr": {
        "webroot": "dist/myApp/browser/" 
      },
      "enabledRepositories": ["spartacus-6"]
    },

Let me know if that works for you ;).