Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
Excluir la ruta API de la autenticación básica HTTP de Nginx

Estoy intentando excluir la ruta API " https://example.com/api/ " de la autenticación básica HTTP de Nginx.

Aquí está mi Nginx Conf:

 server { listen 80; listen [::]:80; server_name example.com; return 302 https://$server_name$request_uri; } server { # SSL configuration listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /etc/nginx/ssl/cert.crt; ssl_certificate_key /etc/nginx/ssl/key.pem; ssl_client_certificate /etc/nginx/ssl/cloudflare.crt; ssl_verify_client on; server_name example.com; root /var/www/mysite; index app.php index.php; location / { try_files $uri $uri/ /app.php$is_args$args; # Restricting Access auth_basic 'Administrator Area'; auth_basic_user_file /etc/apache2/.htpasswd; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; } # Restriction off for api location ^~ /api/ { auth_basic off; allow all; } }

Pero cuando trato de presionar " https://example.com/api/ " en el navegador, todavía me pide autenticación básica. Por lo general, sin autenticación básica, debería proporcionar una respuesta JSON en el navegador.

¿Alguien sabe cómo solucionar este problema? Cualquier tipo de ayuda sería muy apreciada. Gracias.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!