[USER] < NGINX [PROXY / PORT:443] < NGINX [PHP-FPM / PORT:8081]

Hi everybody! I will try to explain the problem...

I have a server running under scheme:

[USER] < NGINX [PROXY / PORT:443] < NGINX [PHP-FPM / PORT:8081]

All scripts are working fine. But ELGG constantly adds port 8081. Ex, I install ELGG:

https://example.org:8081/vendor/elgg/elgg/install/css/install.css

https://example.org:8081/vendor/bower-asset/jquery/dist/jquery.min.js

https://example.org:8081/vendor/elgg/elgg/install/js/install.js

https://example.org:8081/vendor/elgg/elgg/_graphics/elgg_logo.png

https://example.org:8081/vendor/elgg/elgg/_graphics/favicon.ico

NGINX [PHP-FPM]:

server {

  # -------------------------------------------------------------------------- #
  # Variables.
  # -------------------------------------------------------------------------- #

  set $srvUser   "web_example_org";
  set $srvDomain "example.org";

  # -------------------------------------------------------------------------- #
  # Server name & IP.
  # -------------------------------------------------------------------------- #

  listen      8081 ssl http2;
  server_name example.org;

  # -------------------------------------------------------------------------- #
  # Logs.
  # -------------------------------------------------------------------------- #

  error_log   "/home/project/web_cbrspc04/.logs/nginx.error.example.org.log";
  access_log  "/home/project/web_cbrspc04/.logs/nginx.access.example.org.log" main;

  # -------------------------------------------------------------------------- #
  # Root & index.
  # -------------------------------------------------------------------------- #

  root  "/home/project/web_cbrspc04/domain/public_html";
  index index.html index.htm index.php;

  # -------------------------------------------------------------------------- #
  # SSL.
  # -------------------------------------------------------------------------- #

  ssl                 on;
  ssl_certificate     "/home/project/example.org/example.org.crt";
  ssl_certificate_key "/home/global/server.crt.key";

  # -------------------------------------------------------------------------- #
  # Location.
  # -------------------------------------------------------------------------- #

  location / {
    try_files $uri $uri/ @elgg;
  }

  location = /rewrite.php {
    rewrite ^(.*)$ /install.php;
  }

  location ~ \.php$ {
    try_files $uri @elgg;

    fastcgi_pass "unix:/run/php-fpm/$srvDomain.sock";
    fastcgi_index "index.php";
    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    include "/etc/nginx/fastcgi_params";
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }

  location @elgg {
    fastcgi_pass "unix:/run/php-fpm/$srvDomain.sock";

    include "/etc/nginx/fastcgi_params";
    fastcgi_param SCRIPT_FILENAME $document_root/index.php;
    fastcgi_param SCRIPT_NAME /index.php;
    fastcgi_param QUERY_STRING __elgg_uri=$uri&$args;
  }
}

NGINX [PROXY]:

server {

  # -------------------------------------------------------------------------- #
  # Server name & IP.
  # -------------------------------------------------------------------------- #

  listen      443 ssl http2;
  server_name example.org;

  # -------------------------------------------------------------------------- #
  # Logs.
  # -------------------------------------------------------------------------- #

  access_log off;

  # -------------------------------------------------------------------------- #
  # SSL.
  # -------------------------------------------------------------------------- #

  ssl                 on;
  ssl_certificate     "/home/project/example.org/example.org.crt";
  ssl_certificate_key "/home/global/server.crt.key";

  # -------------------------------------------------------------------------- #
  # Location.
  # -------------------------------------------------------------------------- #

  location / {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE_ADDR $remote_addr;
    proxy_pass https://127.0.0.1:8081/;
  }
}