Tengo una configuración de VPS que no funciona correctamente.
Entorno: Ubuntu 18.04, php7.4, postgresql y nginx
La dirección IP del servidor se resuelve con éxito y muestra la página de "Éxito" predeterminada. Sin embargo, el dominio que quiero usar para apuntar al servidor no funciona y resuelve 404. Siento que esta es una solución simple, pero después de un día de búsqueda aún no la he encontrado.
¡Se agradece la ayuda!
Solución de problemas:
nslookup en Windows resuelve el nombre de dominio en la dirección IP correcta (puedo acceder al servidor con solo el nombre de dominio)
el dominio sigue sin encontrarse cuando uso el dominio en mi navegador. Aquí está /etc/nginx/sites-disponible/temp.domain:
server { listen 80; server_name temp.domain; root /var/www/temp.domain/public_html; index index.php index.html; access_log /var/log/nginx/temp.domain.access.log; error_log /var/log/nginx/temp.domain.error.log; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.4-fpm.sock; } location ~ \.php { fastcgi_index index.php; fastcgi_pass unix:/usr/local/var/run/php-fpm.socket; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }configuración predeterminada:
server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; # Add index.php to the list if you are using PHP index index.php index.html index.htm index.nginx-debian.html; server_name 192.169.0.1; #temp ip address location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } # pass PHP scripts to FastCGI server # location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } }tuvo que instalar php-config y luego asegurarse de que php.ini tenga habilitadas las extensiones postgresql. También tuve que arreglar el bloqueo del servidor en los sitios nginx disponibles/predeterminados