I am hosting a customer ecommerce website (Medusa JS) with nodeJS through passenger (and also tried through regular proxypass in .htaccess).
When accessing the site, the browser load some .js assets and they are compressed, so the browser is throwing error when reading the script file.
Uncaught SyntaxError: Invalid or unexpected token (at script.js:1:1)
I tried to disable brotli and gzip completly for this site but it is not working.
I tried those variant in .htaccess and also in the /etc/httpd/conf/siteX{.ssl}/custom
I understand that it might not be a problem with APISCP configuration but I just wanted to make sure.
Basically I would like to know if I am missing something about disabling compression on the httpd side.
There is an environment variable no-brotli , set via SetEnv , which will disable brotli compression for a particular request, even if it is supported by the client.
So that should work OK. I’d check that Pagespeed isn’t interfering with the request:
<IfModule pagespeed_module>
ModPagespeed off
</IfModule>
Thank you for your quick response as always !
I will try some more configuration as you stated.
Also, I noticed a cache on the apache/httpd side.
For example, when I proxy pass all requests to my node app, if I shutdown the node app that is serving all my assets, I can still request some assets. But my node app is down, so there must be a cache with apache. I could not find information on the APISCP documentation about it.
I tried to disable all cache (TBH probably in the wrong way) but I cannot make this work…
How can I disable cache in the .htaccess or in the /etc/httpd/conf/siteX/custom ?
Again, thank you for you time and support,
have a great weekend.
Unfortunately, I was able to reproduce with simple curl.
With curl I was able to get some assets despite my node app was not running.
Then in my curl I added ?no_cache=$(date +%s), and only with this new param I get 502 bad gateway.
But then If I curl the assets without this extra get param, I was able to get the asset even if my node was down.
Thank you,
$ curl https://xxx.com/app/assets/index-BqzOA_eK.css
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
$ curl https://xxx.com/app/assets/index-BqzOA_eK.css?test
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Unavailable</title>
</head><body>
<h1>Service Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>
$ curl https://xxx.com/app/assets/index-BqzOA_eK.css
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.
I curl directly from my PC to APISCP with /etc/hosts file modified so my domain resolv directly to APISCP IP (no cloudflare or third party)
for all those request the node app was down.
And I have this problem about binary data despite requesting a css file.