M
M
mboot2015-09-22 08:41:31
Nginx
mboot, 2015-09-22 08:41:31

Setting up nginx as a backend?

upstream backend {
    server 127.0.0.1:9000;
    server 127.0.0.1:9001;
    server 127.0.0.1:9002;
    server 127.0.0.1:9003;
    server 127.0.0.1:9004;
    server 127.0.0.1:9005;
    server 127.0.0.1:9006;
    server 127.0.0.1:9007;
    server 127.0.0.1:9008;
    server 127.0.0.1:9009;
  }
  location ~ \.php$ {
    root html;
    fastcgi_pass	backend;
    fastcgi_index 	index.php;
    fastcgi_param 	SCRIPT_FILENAME	$document_root$fastcgi_script_name;
    include		fastcgi_params;
  }

What are the pros and cons of such settings and how to do it right? specifically interested in the number of backends.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Spiridonov, 2015-09-22
@customtema

I thought the absolute address to the directory is written to root.
Should location not be inside the host declaration?
Hmm... does this configuration work?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question