All things Shopify and commerce
I'm uploading files to my server using axios, and it works perfectly on requests under 1MB.
However, when I upload over 1MB to my server in a single request my request is blocked and a 413 error is thrown. It shows it's from NGINX in the response:
The request doesn't reach my server and is blocked client side. Any help would be appreciated.
Solved! Go to the solution
This is an accepted solution.
Hope you're having a great day!
You said you were uploading files to your server. So this error has nothing to do with Shopify but rather your server.
Take a look at the Shopify file uploading requirements:
The 413 status code indicates that the request was larger than the server can handle, either due to physical constraints or to settings. Usually, this occurs when a file is sent using the POST method from a form, and the file is larger than the maximum size allowed in the server settings.
You should increase the value of parameters memory_limit, post_max_size, or upload_max_filesize in your server configuration.
If you found this comment useful, hit the 'Like' and 'Accepted solution' buttons.
This is an accepted solution.
After countless days of debugging I finally figured it out. I even started to refactor my entire code just to figure it where it was coming from.
Just like after figuring out most bugs, I feel like it was under my nose the entire time.
Shopify serve wasn't working properly for me a few days ago so I switched to a local tunnel package: http://localtunnel.github.io/www/. I only did some tests a day later with uploads so I didn't realize it was coming from that package.
Localtunnel was blocking all the requests over 1 MB, and once I switched back to ngrok everything worked perfectly. I was correct with the assumption the error was not coming from my application, however I incorrectly guessed it was Shopify when it was actually the local tunnel package.
Thank you for the help @Morek, I appreciate it 🙂
This is an accepted solution.
Hope you're having a great day!
You said you were uploading files to your server. So this error has nothing to do with Shopify but rather your server.
Take a look at the Shopify file uploading requirements:
The 413 status code indicates that the request was larger than the server can handle, either due to physical constraints or to settings. Usually, this occurs when a file is sent using the POST method from a form, and the file is larger than the maximum size allowed in the server settings.
You should increase the value of parameters memory_limit, post_max_size, or upload_max_filesize in your server configuration.
If you found this comment useful, hit the 'Like' and 'Accepted solution' buttons.
This is an accepted solution.
After countless days of debugging I finally figured it out. I even started to refactor my entire code just to figure it where it was coming from.
Just like after figuring out most bugs, I feel like it was under my nose the entire time.
Shopify serve wasn't working properly for me a few days ago so I switched to a local tunnel package: http://localtunnel.github.io/www/. I only did some tests a day later with uploads so I didn't realize it was coming from that package.
Localtunnel was blocking all the requests over 1 MB, and once I switched back to ngrok everything worked perfectly. I was correct with the assumption the error was not coming from my application, however I incorrectly guessed it was Shopify when it was actually the local tunnel package.
Thank you for the help @Morek, I appreciate it 🙂
Hope you're having a great day!
You're welcome. I'm happy you've found a solution.
Have a good luck.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025