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

185
Views
Servir archivo PDF por ubicación y parámetro de consulta

¿Cómo puedo servir un archivo PDF en la siguiente dirección:

127.0.0.1/getMeThatFile/willYou?name=jane

que se almacena en una ubicación:

/usr/share/nginx/thatFile.pdf

Intenté seguir el archivo Serve pdf por ubicación en nginx , pero no pude hacerlo funcionar:

 server { location /getMeThatFile/willYou/ { alias /usr/share/nginx/; return 302 thatFile.pdf; } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

/getMeThatFile/willYou y /getMeThatFile/willYou/ son URI diferentes. Su pregunta sugiere que la solicitud utilizará la primera, pero su solución coincide con la segunda.

Use location /getMeThatFile/willYou para hacer coincidir ambos, o location = /getMeThatFile/willYou para hacer coincidir solo el primero. Vea este documento para más detalles.

Para devolver un solo archivo, use root y try_files . Por ejemplo:

 location = /getMeThatFile/willYou { root /usr/share/nginx/; try_files /thatFile.pdf =404; }

Suponiendo thatFile.pdf siempre existe, el =404 nunca se alcanza, pero es necesario ya que try_files requiere al menos dos parámetros. Vea este documento para más detalles.

over 4 years ago · Santiago Trujillo Report
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!