Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.3K
Vistas
Nginx 403 Prohibido para ubicación y localhost

Mi objetivo es acceder a una ubicación específica (es decir, phpmyadmin) usando un túnel SSH http://localhost/phpmyadmin

Acabo de instalar Ubuntu 20.04 con Nginx. La siguiente configuración funcionaba bien con Ubuntu 18.04.

Edité /etc/nginx/sites-available/default agregando:

 location /phpmyadmin { #Allow localhost allow 127.0.0.1; #deny all the others ip deny all; }

cuando accedo a http://localhost/phpmyadmin recibo el mensaje de error:

403 Prohibido nginx/1.17.10 (Ubuntu)

Solo para probar, eliminé "negar todo"; todo funciona bien, pero cada dirección IP puede acceder a la ubicación phpmyadmin.

registro de errores nginx:

2020/05/05 23:52:13 [error] 21905#21905: *1 acceso prohibido por regla, cliente: ::1, servidor: _, solicitud: "GET /phpmyadmin/ HTTP/1.1", host: "localhost "

 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.html index.htm index.nginx-debian.html index.php; server_name _; 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; } location /phpmyadmin { satisfy all; allow 127.0.0.1; deny all; } }

¿Alguna idea de por qué esta configuración ya no funciona con ubuntu 20.04 y nginx 1.17.10?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

También debe permitir :: 1 ... Y agregar los parámetros para el php dentro del bloque de ubicación también.

Prueba así

 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.html index.htm index.nginx-debian.html index.php; server_name _; 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; } location ^~ /phpmyadmin/ { allow 127.0.0.1; allow ::1; deny all; include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; } }
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda