Hello
Apres avoir eu des soucis avec mon reverse proxy voir ici 400 BAD REQUEST
J’ai eu comme erreur
unable to connect to home assistant
Pourtant mes redirection est autres étais OK
Le souci venait du fait que je devais modifié mon fichier
/etc/nginx/sites-available/hello.fr
Voici le fichier corrigé
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream websocket {
server 127.0.0.1:8080;
}
server {
server_name jd.hello.fr www.jd.hello.fr;
location /websocket {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
location / {
proxy_pass http://192.168.2.7:8123;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/jd.hello.fr/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/jd.hello.fr/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.jd.hello.fr) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = jd.hello.fr) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name jd.hello.fr www.jd.hello.fr;
return 404; # managed by Certbot
}
Mon fichier avant correction
server {
server_name jd.hello.fr www.jd.hello.fr;
location / {
proxy_pass http://192.168.2.7:8123;
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;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/jd.hello.fr/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/jd.hello.fr/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.jd.hello.fr) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = jd.hello.fr) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name jd.hello.fr www.jd.hello.fr;
return 404; # managed by Certbot
}