F
F
Ford92018-04-03 15:43:19
Nginx
Ford9, 2018-04-03 15:43:19

How to add upstream module to nginx?

os: Ubuntu 16.04
nginx version: nginx/1.12.2
configure arguments:
--with-cc-opt=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2
--with-ld -opt=-Wl,-z,relro -Wl,-z,now
--prefix=/usr/share/nginx
--conf-path=/etc/nginx/nginx.conf
--http-log-path=/ var/log/nginx/access.log
--error-log-path=/var/log/nginx/error.log
--lock-path=/var/lock/nginx.lock
--pid-path=/run/ nginx.pid
--modules-path=/usr/lib/nginx/modules
--http-client-body-temp-path=/var/lib/nginx/body
--http-fastcgi-temp-path=/var/ lib/nginx/fastcgi
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-scgi-temp-path=/var/lib/nginx/scgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi
--with-debug
--with-pcre-jit
--with-http_ssl_module
--with-http_stub_status_module
--with-http_realip_module
--with-http_auth_request_module
--with-http_v2_module
--with-http_dav_module
--with-file-aio
--with-threads
--with-http_addition_module
--with-http_geoip_module=dynamic
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_image_filter_module= dynamic
--with-http_secure_link_module
--with-http_sub_module
--with-http_xslt_module=dynamic
--with-stream=dynamic
--with-stream_realip_module
--with-stream_geoip_module
--with-stream_ssl_module
--with-stream_ssl_preread_module
--with-mail=dynamic
--with-mail_ssl_module --add
-dynamic-module=/usr/src/builddir/debian/modules/nginx-auth- pam --add
-module=/usr/src/builddir/debian/modules/nginx-dav-ext-module
--add-module=/usr/src/builddir/debian/modules/nginx-echo
--add-module =/usr/src/builddir/debian/modules/nginx-upstream-fair
--add-module=/usr/src/builddir/debian/modules/ngx_http_substitutions_filter_module
--add-module=/usr/src/builddir/debian/ modules/nginx-cache-purge
Server settings

upstream backend  {
  server 127.0.0.1:2;
  server 127.0.0.1:3;
  server 127.0.0.1:4;
}
server
{
  server_name	******.ru;
  root		/var/www/******.ru/public;
  index		index.php index.html index.htm;

  access_log	/var/www/******.ru/logs/nginx.access.log;
  error_log	/var/www/******.ru/logs/nginx.errors.log;

    location / {
  proxy_pass  http://backend/;
      }
}

Purpose of the task: So that php would respond to several requests at the same time. If you write on page 1 and try to open the second page, the server will not respond for 30 seconds. This configuration via upstream solves this problem. In this example, it creates up to 3 independent php processes, each of which runs under its own port. Problem: Upstream does not work due to its absence in the nginx configuration. I rummaged through a bunch of articles, nothing helped, I can not add this module. Or are there other options to get around this problem? Below I will give 2 links to instructions, the implementation of which did not lead to a positive result. nginx.org _sleep(30)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question