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

370
Vistas
Rewrite URL /blog/content/images/**/* to /content/images/**/*

My front-end is hitting /blog/content/foo/bar.jpg when looking for static assets.
How can I make NGINX redirect those requests to /content/foo/bar.jpg instead?

At first I tried this:

location ~ ^/blog/content/ {
    root /var/www/ghost/content/;
}

Apparently it didn't work – (btw, I'm testing each change in the .conf file with a sudo nginx -s reload + F5 in the browser.. is there a better way to test/debug NGINX behavior (and actually understand what's going on instead of this "worked / didn't work" feedback I get with each F5?)

Then, I tried this one I found in a cheatsheet – at the server level:

rewrite ^/blog/content/(.*)$ /$1 last;

Again, without luck. What bothers me is that I can't even see what the line above is doing and why it isn't working.

Someone, please, get me out of this "google for a solution -> try something that looks promising --> hit F5 hoping it works (it doesn't) -> google for a solution" loop.

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

0

The solution I found was to rewrite with:

rewrite ^/blog/(.*)$ /$1 last;

But it isn't ideal. I'd prefer to rewrite only when the URI contains "/blog/content/"..

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