http status code 502 – nginx: 502 bad gateway if /index.html is not in URL – Stack Overflow
i don’t understand what i’m doing wrong so i hope somebody can help 🙂
When i access http://10.0.0.54/index.html
i get the right page but if i try to access http://10.0.0.54
instead of showing the index file it redirects me to https://10.0.0.54
showing error 502 bad gateway.
This is the configuration /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html/salvaderi;
index index.html;
server_name _;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html/salvaderi;
}
location / {
root /var/www/html/salvaderi;
index index.html;
}
}
I am running nginx 1.18.0 on ubuntu 22.04
i tried changing parameters inside location /{}
but i always get the same result. I also changed the root directory and made sure permission where set right. Searching on for the solution i saw other people having problems about PHP and FastCGI but i am not using it.
Read more here: Source link