-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How ı can change variable #34
Comments
@fatalafitili |
@rryqszq4 I wait u |
@fatalafitili Try the following example: ...
set $sel 0;
location = / {
access_by_php '
$x = 1;
ngx_var::set("sel", $x);
';
content_by_php '
echo ngx_var::get("sel");
';
}
... |
I know it works but I want to change a variable in nginx. for example
@rryqszq4 Isn't it possible ? |
@fatalafitili |
@rryqszq4 |
@fatalafitili |
Okay, buddy, I'm gonna do it for now, but I'm waiting for an update. :) |
Change access_by_php to rewrite_by_php, I found it is ok. ...
set $sel 0;
location = / {
rewrite_by_php '
$x = 1;
ngx_var::set("sel", $x);
';
return 200 $sel;
}
... |
Oh I so happy, this worked thanks dude, i love u <3 @rryqszq4 |
Hello dude i again here :) my problem is not fully solved, look this; it's not complete, but it's logic i did use this but this is not worked, 404 does not; i need this: Example: (php counts how many times each user enters) php variable if 100, nginx variable 1 do if nginx variable 1, go return 404 else go location / i need to do this, can u help again me ? @rryqszq4 |
`user www www;
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
}`
return 200 $sel; 0 gives
How ı can do ? Can u help me ?
The text was updated successfully, but these errors were encountered: