New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Nginx help please
I have this block in the nginx.conf. IP stands for actual IPs.
What I need is to IP restrict requests to /admin/ and /admin/whateverpath
location ~ ^/admin(/.*)?$ {
allow IP;
allow IP;
allow IP;
allow IP;
allow IP;
deny all;
}
But when this is in effect, it blocks all ips including the allowed IPs.
What am I doing wrong here? Thank you for any help.
Comments
how about this?
Thank you, this is what I initially had, same issue. Will try again and post here.
is it a php application? are you handling .php seperately?
Thank you
Ruby app, yes handling Ruby here
Make sure you're not behind a proxy.
Or use something like:
set_real_ip_from proxy_server_ip;
real_ip_header X-Forwarded-For;
How about:
So.. it reads from top to bottom so invert that and put deny all on top
Thank you
So, did you try any of options posted here and did any work ?
The maintenance window is not up yet. Tomorrow morning I will.
Oh wow, did not know that.. Do you expect that '/etc/init.d/nginx reload' would cause downtime ?
also, before reloading/restarting you can run "nginx -t" to check if there are any config errors.
No, but we have to follow the protocol. If the new edits break access for people its not ideal.
This worked
Was that inside location section, like so:
Or did you put it before?
Before allow IP