I have a nginx server running served through cloudflare.
I get the web server is down (521) error
My nginx config is the following:
conf.d/default.conf:
server {
listen 80;
listen 443 ssl;
server_name br.myserver.com;
ssl_certificate /etc/ssl/certificate.crt;
ssl_certificate_key /etc/ssl/private.key;
#access_log /var/log/nginx/host.access.log main;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_pass https://0.0.0.0:5173;
}
}
nginx.conf:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
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;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
This config is the exact same I have on another server working perfectly fine so I thought the problem might come from the cloudflare DNS record which is different but I don’t see anything wrong with it
I know that the dynv6 address works fine because I can connect to the server via ssh with it.
I also know that the app works as intented locally on https://0.0.0.0:5173.
systemctl status nginx
displays the server running fine
journalctl -u nginx.service same
ss -lnpt | grep nginx shows nginx is listening to both http and https requests.
I have also checked with ufw status that the firewall is not blocking those ports.
What am I missing?