Você precisará criar vários locais para lidar com as diferentes situações:
# including your fastcgi params at a higher level
# allows them to be inherited in both locations
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
# regex locations are matched in order, so this will handle
# /anything/signup.php and /anything/login.php
# If you want to just have /signup.php and /login.php,
# add ^ before the / or you could split this into two more:
# location = /signup.php abd location = /login.php
location ~ /(signup|login)\.php$ {
fastcgi_pass php;
}
# this will handle the rest of the php requests
location ~ \.php$ {
# Only allow GET and HEAD requests for all other php scripts
limit_except GET HEAD {
allow 1.1.1.1/32; #trusted ip
deny all;
}
fastcgi_pass php;
}