Home  >  Q&A  >  body text

nginx pseudo-static problem

Accessing an image actually returns an html page

rewrite /123.html /123.jpg;

It may be a bit strange, but it can only be used in the project. Is this reliable?

高洛峰高洛峰2714 days ago432

reply all(1)I'll reply

  • 为情所困

    为情所困2017-05-16 17:12:08

    It’s best to have a prefixed path or something like rewrite /img/{var}.jpg /img/{var}.html, otherwise there will be problems when you want to use the images in the server

    reply
    0
  • Cancelreply