Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http / https Issue deploying to server using pm2, loop occurring when trying to access via domain #8

Open
leemethvenmtc opened this issue Aug 17, 2021 · 3 comments

Comments

@leemethvenmtc
Copy link

Hi,

Having an issue trying to deploy this onto a server, we've setup an nginx server with yarn 1, node 14, npm 6

We're using pm2 to handle instances / ensure continuous deployment.

It works absolutely fine via server IP, e.g. we can access via http://iphere:3800 but setting up a domain to proxy that, e.g. just a general url, it's causing a redirect loop and memory is spiking, the items looping are:

89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:24:22 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 301 169 "-" "axios/0.21.1" "-"

This keeps going until the server eventually returns a 504 gateway timeout.

Is there anything specifically needing done to help this work on a server? I see the demo is working fine, just trying to figure out where we're going wrong.

Thanks,
Lee

@leemethvenmtc
Copy link
Author

Hi,

More info on this, we found issue was tied to https, so we set it up to work on http and https, and it's appearing fine now via domain.

Our server admin has pointed out the issue is mainly on product page, these queries

89.145.68.175 - - [17/Aug/2021:11:46:39 +0100] "POST /api/shopify/fetchCustomer HTTP/1.1" 200 5 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:46:39 +0100] "POST /api/shopify/createCart HTTP/1.1" 200 124 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:46:39 +0100] "POST /api/shopify/checkOut HTTP/1.1" 200 2644 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:46:40 +0100] "POST /api/shopify/getCategory HTTP/1.1" 200 1033 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:46:40 +0100] "POST /api/shopify/getProduct HTTP/1.1" 200 7462 "-" "axios/0.21.1" "-" 89.145.68.175 - - [17/Aug/2021:11:46:40 +0100] "POST /api/shopify/getProduct HTTP/1.1" 200 2 "-" "axios/0.21.1" "-"

Are being fired over http, not https, and as we're forcing https via nginx, it was causing the redirect loop.

Is someone able to look into this please? I would think all queries should be https?

Thanks,
Lee

@leemethvenmtc leemethvenmtc changed the title Issue deploying to server using pm2, loop occurring when trying to access via domain http / https Issue deploying to server using pm2, loop occurring when trying to access via domain Aug 17, 2021
@odranoelBR
Copy link

Hi @leemethvenmtc i'm passing throw the same problem, exact setup.
I'm trying to change the nuxt applications send https
Doc: https://docs.vuestorefront.io/v2/architecture/networking.html

@bloodf
Copy link
Contributor

bloodf commented Jan 23, 2022

Can you provide the PM2 configuration file and the Nuxt configuration file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants