Abaixo está o arquivo nginx.conf para minha configuração
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
upstream 135.250.138.150 {
server 135.250.138.74:8666;
server 135.250.138.75:8666;
keepalive 50;
# check interval=3000 rise=2 fall=2 timeout=1000 type=http;
}
server {
# listen 80 default_server;
# listen [::]:80 default_server;
listen 80;
# server_name www.server.com;
server_name _;
root /usr/share/nginx/html;
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://135.250.138.150;
proxy_set_header Connection "";
proxy_http_version 1.1;
}
location /status {
proxy_pass http://135.250.138.150;
check_status;
}
}
server {
#Start
#Added After SSL certification created
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name _;
root /usr/share/nginx/html;
keepalive_timeout 100s;
ssl_certificate /etc/nginx/ssl/tls.crt;
ssl_certificate_key /etc/nginx/ssl/tls.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
include /etc/nginx/default.d/*.conf;
location /auth {
proxy_pass https://135.250.138.150;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location /status {
proxy_pass http://135.250.138.150;
check_status;
}
}
}
Aqui estão os detalhes do log sobre o erro do arquivo /var/log/nginx/error.log
2018/01/04 13:30:28 [error] 471#471: *47 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:30:30 [error] 471#471: *48 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:30:31 [error] 471#471: *48 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "135.250.138.150", referrer: "http://135.250.138.150/status" 2018/01/04 13:31:09 [error] 471#471: *48 open() "/usr/share/nginx/html/check_status" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /check_status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:31:18 [error] 471#471: *50 open() "/usr/share/nginx/html/check_status" failed (2: No such file or directory), client: 10.143.80.228, server: _, request: "GET /check_status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:31:18 [error] 471#471: *50 open() "/usr/share/nginx/html/404.html" failed (2: No such file or directory), client: 10.143.80.228, server: _, request: "GET /check_status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:31:24 [error] 471#471: *50 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:39:38 [error] 471#471: *52 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:39:45 [error] 471#471: *54 open() "/usr/share/nginx/html/check_status" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /check_status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:39:50 [error] 471#471: *54 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:39:57 [error] 471#471: *56 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:42:13 [error] 1355#1355: *2 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:42:20 [error] 1355#1355: *3 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:43:19 [error] 1419#1419: *1 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:43:26 [error] 1419#1419: *3 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:43:27 [error] 1419#1419: *6 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:46:30 [error] 1567#1567: *1 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 10.143.80.228, server: localhost, request: "GET /status HTTP/1.1", host: "135.250.138.150" 2018/01/04 13:46:40 [error] 1567#1567: *4 http upstream check module can not find any check server, make sure you've added the check servers, client: 10.143.80.228, server: _, request: "GET /status HTTP/1.1", host: "135.250.138.150"
Tags nginx