Answer the question
In order to leave comments, you need to log in
Nginx, php variable?
There is a task: php gives a variable and nginx needs to take this variable and insert it into proxy_pass, how can I implement this? And how should I give php this variable so that nginx can process it? Thanks to everyone who helps.
Answer the question
In order to leave comments, you need to log in
In general, what specific problem are you trying to solve with such manipulations?
Regarding the question, maybe ngx_http_ssi_module will help you .
Or maybe something like this is needed?
Nginx can make requests to memcached and redis. Let nginx take the proxy_pass value from redis.
PHP on apache_mod_php or FastCGI?
For the first case: proxy_set_header will come to $_SERVER['HTTP_*']
For the second case, fastcgi_param will come somewhere in theory, I didn't check it myself.
Keep it simple
mickeyben.com/2009/12/30/using-nginx-as-a-load-balancer.html
wiki.nginx.org/LoadBalanceExample
And don't ask anything from servers
When changing proxy_pass, nginx also needs to be distorted. Can it be easier to generate a new config (or part of it) for nginx using php?
Measure server load from php, use nginx as a load balancer... Don't you want to look for tools specifically designed to solve such problems? Maybe ipvs, haproxy will suit you?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question