Welcome! Log In Create A New Profile

Advanced

Nginx does not route traffic to https

Posted by alps.kab@gmail.com 
Nginx does not route traffic to https
September 06, 2024 03:04AM
This is my nginx conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
#load_module /usr/lib64/nginx/modules/ngx_stream_module.so;

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"';
resolver 169.254.169.253 ipv6=off;
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/http_error.log debug;

sendfile on;
tcp_nopush on;
keepalive_timeout 65;
types_hash_max_size 4096;

include /etc/nginx/mime.types;
default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;


server {
listen 80 proxy_protocol;
server_name _;

location / {
# return 200 "Hello from nginx!";
#}

#location /example/ {
proxy_pass http://lattice dns name;
proxy_http_version 1.1;
proxy_set_header Host "domainname;

}
}
}

stream {

log_format basic '$time_iso8601 $remote_addr $proxy_protocol_addr $proxy_protocol_port $protocol $server_port '
'$status $upstream_addr $session_time $upstream_connect_time';

access_log /var/log/nginx/stream_access.log basic;
error_log /var/log/nginx/stream_error.log debug;

resolver 169.254.169.253 ipv6=off;


server {
listen 443 proxy_protocol;
proxy_pass 169.254.171.1:443;
proxy_protocol on;
ssl_preread on;
}
}



i get 2024/09/06 06:54:57 [error] 16#16: *4672 broken header: "" while reading PROXY protocol, client: , server: 0.0.0.0:443


when connecting to applciation it gives me

User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
* Empty reply from server
* Closing connection
curl: (52) Empty reply from server

can you please help
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready