Hey Peter,

Thanks so much for the helpful response.

I'm only now seeing the response, I needed this weeks ago. It went to my spam 😭😭

Anyways, I added the rewrite:trace3 to the LogLevel and some Apache errors did appear indeed.

<date>   Error    <ip> [rewrite:trace2] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] init rewrite engine with requested uri /                Apache error <date>   Error    <ip>        [rewrite:trace3] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] applying pattern '^(.*)$' to uri '/'                Apache error <date>    Error    <ip>        [rewrite:trace3] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] applying pattern '^(.*)$' to uri '/'                Apache error <date>    Error   <ip>        [rewrite:trace3] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] applying pattern '^(.*)$' to uri '/'                Apache error <date>    Error    <ip>        [rewrite:trace3] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] applying pattern '^(.*)$' to uri '/'                Apache error <date>    Error    <ip>        [rewrite:trace3] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] applying pattern '^' to uri '/'                Apache error <date>    Error    <ip>        [rewrite:trace2] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] rewrite '/' -> 'https://<redacted>.<redacted>.com/' Apache error <date>   Error    <ip>        [rewrite:trace2] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] explicitly forcing redirect with https://<redacted>.<redacted>.com/ Apache error <date>    Error    <ip>        [rewrite:trace2] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] setting lastsub to rule with output https://%{HTTP_HOST}%{REQUEST_URI}                Apache error <date>    Error    <ip>        [rewrite:trace1] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] escaping https://<redacted>.<redacted>.com/ for redirect        Apache error <date>    Error    <ip>        [rewrite:trace1] mod_rewrite.c(490): 127.0.0.1 - - [<redacted>.<redacted>.com/sid#5583ddf8eb88][rid#7efbfc16ff50/initial] redirect to https://<redacted>.<redacted>.com/ [REDIRECT/301]

Does this confirm what was highlighted in the github repo as the issue?

May I ask what would you suggest?

Thanks,

Lee Daniel

On 9/23/24 02:47, Peter Bowyer wrote:
Hi Lee,

This bit in your Apache config looks wrong: https://github.com/cnm-Git/Varnish-Default-VCL-Rules/blob/dfc45d79caca4bc05d778ba21e15b1d1ad0892d4/httpd.conf#L102-L114

When a request comes in for https://<redacted>.<redacted>.com it gets redirected to... https://<redacted>.<redacted>.com. Cue endless loop.

Add rewrite:trace3 (or higher) to your LogLevel to get what's happening in the RewriteRules logged.

Peter

On Sun, 22 Sept 2024 at 08:49, Lee Daniel <[email protected]> wrote:

    Hey Guys,

    My earlier question was "When to use Varnish in front or behind
    NGinx."

    Thanks much for the responses and advise.

    I actually prefer it the way that was suggested nginx:443->
    varnish:6081 -> httpd:7080.
    That way, in plesk, I can configure nginx per site. The issue I am
    having now is when I set it up that way I get too many redirects.
    Through Varnishstat, I can see the hits being made but the webpage
    won't load. I have uploaded my configuration on github to reduce
    the text and ease to read. If anyone has the patience can you tell
    me what needs to be adjusted. I will upload my .htaccess,
    nginx.conf, httpd.conf and default.vlc.
    Repo here <https://github.com/cnm-Git/Varnish-Default-VCL-Rules>.
    I hope I did not do a terrible Job redacting.
    As of now my backend health is 5/5. The default.vlc I found
    online, claim to be well tailored for Drupal sites. Made little
    tweaks. I will appreciate any help. Regards, Lee
    _______________________________________________
    varnish-misc mailing list
    [email protected]
    https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc



--
Maple Design Ltd
http://www.mapledesign.co.uk
<http://www.mapledesign.co.uk/>+44 (0)330 122 0034

Reg. in England no. 05920531
Prices exclude VAT where applicable
--
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to