I have a ubutu server with nginx and uses cloudflare as dns I access a panel by doing mydomain.com:8443 and I would like that I have this panel by doing panel.mydomain.com
So I add an nginx configuration such as :
server {
listen [::]:80;
server_name panel.mydomain.com www.panel.taritaugustin.com;
location / {
proxy_pass http://localhost:8443;
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 X-Forwarded-Proto $scheme;
}
}
I also added an AAAA type DNS record to my server with panel.mydomain.com.
But when I go to panel.mydomain.com I get an error:
502 Bad Gateway nginx/1.24.0 (Ubuntu)
,
while it works by going to mydomain.com:8443.
So I need your help to solve this problem, thank you