Hi, I have configured varnish with Magento 2.3.x and its working fine with the sub folders and pages. However, when I open domain.com in the browser it gives me 503 error. But domain.com/index.php/ works fine.
What I want to achieve here is I want to remove /index.php/ and let the user view from domain.com/ instead.
Now, this works absolutely fine in Nginx, I have rules in nginx and it works fine, but when I configure it with varnish i get this issue.
My nginx & varnish (default.vcl) is given below. I believe varnish is somehow rejecting domain.com.
nginx.conf: https://pastebin.com/raw/tQ9wAmEP
default.vcl: https://pastebin.com/raw/JmE5fncy
I have already made suggested changes by Magento docs i.e.
-p http_resp_hdr_len=65536
-p http_resp_size=98304
-p workspace_backend=98304
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.
Your issue might be with an incorrect Varnish configuration, or it could be a problem with the Nginx configuration and how it interacts with Varnish. You mentioned that you have made the suggested changes by Magento docs, but still experiencing issues.
In your Varnish default.vcl, it’s important to properly set backend settings pointing to your Nginix and ensure that req.http.host is correctly defined.
Consider modifying your Varnish configuration and take care of the following points:
- Make sure your backend default points Nginx correctly. Confirm the health status of your backend server after modifying the Varnish settings with the command: varnishadm debug.health-
Ensure that the req.http.host is correctly defined for your domain.
If the problem persists after making these changes, please refer to the DigitalOcean Docs at How To Configure Varnish Cache and How To Configure Nginx as a Web Server and Reverse Proxy for Apache on One Ubuntu 20.04 Server. These articles provide a detailed overview of configuring Varnish with Nginx. If all else fails, you may consider seeking further assistance from the Magento community forums.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.