@alllstar

Connect() failed (111: Connection refused) while connecting to upstream, неправильно формируется upstream?

Всем привет, в чем суть: возникает вот такая ошибка, особо на работу не влияет, но перестало работать превью ссылок, и я полагаю это все связано. Правильно ли формируется upstream? Меня он смущает, хотя конфиг написан как https://www.digitalocean.com/community/tutorials/h...
Вот сама ошибка:
2020/03/21 15:58:13 [error] 1299#1299: *162014 connect() failed (111: Connection refused) while connecting to upstream, client: 172.69.54.95, server: example.com, request: "GET / HTTP/1.1", upstream: "127.0.0.1:5623/https://example.com", host: "example.com"

upstream example {
   server unix:/home/exapmle.com/website/backend/shared/tmp/sockets/puma.sock;
}

# for redirecting http traffic to https version of the site
server {
  listen         80 ssl http2;
  listen    [::]:80;

  server_name exapmle.com;
  return 301 https://exapmle.com$request_uri;
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name exapmle.com;
  access_log  /var/log/nginx/exapmle_access.log;
  error_log  /var/log/nginx/exapmle_error.log  info;

  # Prerender
  include /etc/nginx/features/prerender.conf;

  # GZIP
  gzip on;
  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 6;
  gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_types
     text/plain
     text/css
     application/json
     application/javascript
     text/xml
     application/xml
     application/xml+rss
     text/javascript
     image/svg+xml;

  # SSL
  ssl on;
  ssl_session_cache   shared:SSL:10m;
  ssl_session_timeout 10m;
  ssl_prefer_server_ciphers on;
  ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers         HIGH:!aNULL:!MD5;
  ssl_stapling on;
  resolver 8.8.8.8;
  ssl_dhparam /etc/ssl/certs/dhparam.pem;

  ssl_certificate /etc/letsencrypt/live/exapmle.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/exapmle.com/privkey.pem;

  # Other settings
  charset utf-8;

  # Path
  root /home/exapmle/website/frontend/current/www;

  location / {
    include /etc/nginx/features/auth_basic.conf;
    try_files $uri @prerender;
  }

  location @example {
      proxy_pass http://example;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header Host $http_host;
      proxy_redirect off;
  }

  location /sitemap.xml {
    include /etc/nginx/features/auth_basic.conf;
    root /home/example/website/backend/current/public;
  }

  location /uploads {
    include /etc/nginx/features/auth_basic.conf;
    root /home/example/website/backend/current/public;

    expires 1y;
    gzip_static on;
    add_header Cache-Control public;
    add_header ETag "";
    access_log off;
    try_files $uri @example ;
  }

  location ~ ^/(css|js)/ {
    expires 1y;
    add_header Cache-Control public;
    add_header ETag "";
    access_log off;

    try_files $uri @example;
  }

  location ~ ^/images/ {
    expires 600;
    add_header Cache-Control public;

    try_files $uri @example;
  }

  location /public {
    include /etc/nginx/features/auth_basic.conf;
    root /home/example/website/backend/current/public;
    access_log off;
    try_files $uri $uri/index.html @example;
  }

  location /api {
    include /etc/nginx/features/auth_basic.conf;
    root /home/exapmle/website/backend/current/public;

    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

    if ($request_method = 'OPTIONS') {
      return 204;
    }

    try_files $uri/index.html $uri @exapmle;
  }

  location /api/one_s {
    auth_basic off;
    try_files $uri @exapmle;
  }

  location /soap {
    include /etc/nginx/features/auth_basic.conf;
    root /home/example/website/backend/current/public;
    try_files $uri @example ;
  }

  location /admin {
    include /etc/nginx/features/auth_basic.conf;
    root /home/example/website/backend/current/public;
    try_files $uri/index.html $uri @example;
  }

  location /ckeditor {
    include /etc/nginx/features/auth_basic.conf;
    root /home/example/website/backend/current/public;
    try_files $uri @example;
  }

  location ~ ^/assets/ {
    include /etc/nginx/features/auth_basic.conf;
    root /home/example/website/backend/current/public;

    gzip_static on;
    expires 1y;
    add_header Cache-Control public;

    add_header ETag "";
    access_log off;
  }

  location ~ /.well-known {
    root /var/www/html;
    allow all;
  }

  keepalive_timeout 10;
  client_max_body_size 1G;

}
  • Вопрос задан
  • 1352 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы