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

314
Vistas
Nginx Configuration for Dynamic URL Segments as Arguments for Parent Segment Index

I am trying to set a location in the configuration that allows me to do something like https://example.com/car/<vin> which would not go to a <vin> application or directory but to /car/index.html. From there, I would read the URL or pass <vin> to /car/index.html.

I have tried various regex location blocks, like the one below, but they all result in a 404 when accessing /car/<vin>.

location ~ ^/car/(.*)$ {
    root $document_root/car/
    index index.html;
}

What would be an appropriate location block?

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

0

Do you want to use a regular expression? The prefix location would also work as it matches any URI that begins with /car/. See this document for details.

For example:

location ^~ /car/ {
    try_files /car/index.html =404;
}

Using $document_root in the root statement may not work, and the index directive only works with URIs that end with a /. The try_files statement is probably the simplest solution. See this document for details.

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