1

Daft question

We have a symfony-app example.com root would be /home/example/public_html/web

In the symfony-app we have a location path of example.com/tools/

We wanted to setup some restrictions to this location block in Nginx

but everything we've tried doesn't seem to map?

is it possible to do this in nginx or does it have to be done in symfony?

basic rules like

location ~ /tools {
  deny all;
}

have no effect at all on example.com/tools

2 Answers 2

1

Return a response too:

location ~ /tools {
    deny all;
    return 403;
}
Sign up to request clarification or add additional context in comments.

Comments

0

You can add a restriction by the ip-address - just allow the local query and for others deny, like there:

location ~ /tools {
  allow 127.0.0.1;
  deny all;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.