Nginx rewrite or internal redirection cycle while internally redirecting to error page - wp site

Discussion in 'Installation/Configuration' started by Enrico R, Sep 24, 2023.

  1. Enrico R

    Enrico R New Member

    Hi everyone,
    I'm a newbie on the Nginx server - Ispconfig 3, used for a wordpres site.
    I am successfully blocking some spam / intrusive bot adding in the nginx Directives section of the Options this:
    Code:
    if ($http_user_agent ~* (SemrushBot|Semrush|etc|etc) )
    { return 403; }
    But blocking them gives me this return in the error log file:
    Code:
    rewrite or internal redirection cycle while internally redirecting to "/error/403.html"
    Before the last code in the Ispconfig's Nginx directive section there is this
    Code:
    try_files $uri $uri/ /index.php?$args;
    The /error directory is in the same filesystem of the worpress site and have the same owner, and the errors files too: /error/400.html (and so far so fort).
    I have checked already for the same problem but I have found nothing right about this and I don't want to make some mistake copying the few things I have found about other kind of sites .
    I hope those information are enough and I thanks in advance for any help
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Basically you will need this for WP site to work, so go back to that to get a working WP site again. I can't comment on your bot blocking code as I never used them, so wait for or do consult to those who are using them.
     
  3. Enrico R

    Enrico R New Member

    Thanks, I didn't touch this line of code, Wp is working.
    My problem is only in the error pages: Nginx make an error when redirct the bad bpts to them.
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Did you check that site vhost because so far that I know an ISPConfig nginx server block already defined error 403 page so your code may be conflicting.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Uncheck custom error pages checkbox in website settings.
     

Share This Page