• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!

Resolved Part of nginx config file is being overridden somewhere

KurtLowe

New Pleskian
Server operating system version
Ubuntu 24.04.1
Plesk version and microupdate number
18.0.64
Hi All,

I have been making some additions to my nginx config file in order to redirect users from domain.com/pages/example.php to domain.com/example. I was stuck on it for a while, with the location block not seeming to be matched unless I used an equal sign for exact matching. After commenting out the rest of my config, it was still being overridden somewhere. I adjusted to to just return a 403 to make it easier to test.

location /pages/example.php {
return 403;
}

My nginx config file now only consists of this, but is somehow being overridden. Surely something on plesk is causing this, any ideas?
 
Hi,

You need a regex match on the location. Your location directive will not work in a Plesk environment because you have a "location /" earlier in the server block.

Try:
Code:
location ^~ /pages/example.php {
return 403;
}

 
Hi,

You need a regex match on the location. Your location directive will not work in a Plesk environment because you have a "location /" earlier in the server block.

Try:
Code:
location ^~ /pages/example.php {
return 403;
}

This has worked, thank you! Didn't know this was needed when writing in a plesk environment
 
Back
Top