search

Home  >  Q&A  >  body text

Operation and Maintenance - How to configure nginx jump

Hello everyone:

May I ask nginx how to configure automatic jump, for example, when accessing /work, how to automatically jump to /work/001.

Specifically:

I have two site access addresses: /work/001 and /work/002. If I access /work directly, it is404,
I want to configure an automatic jump for the path /work through nginx,
is to access /work Automatically jump to /work/001,
If you directly access /work/001 or /work/002, you will directly access the corresponding site.

I have been searching for a long time and found that most of them are talking about rewrite, but I still don’t understand the specific usage. I hope the master can give specific configurations.

grateful!

滿天的星座滿天的星座2747 days ago918

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-06-28 09:30:51

    location = /work {
        return 302 /work/001;
    }

    reply
    0
  • 滿天的星座

    滿天的星座2017-06-28 09:30:51

    301, 302 jump, simple and affordable

    reply
    0
  • Cancelreply