nginx redirect POST requests

前端 未结 1 916
别那么骄傲
别那么骄傲 2021-01-23 01:36

I have a web server which accepts https://www.example.com/API/ooo/xxx, https://www.example.com/API/aaa/bbb, and https://www.example.com/API/xxx/y

相关标签:
1条回答
  • 2021-01-23 02:00

    Use a return statement. You can use a regular expression location block to capture the part of the URI to return.

    For example:

    location ~ ^/API(/.*)$ {
        return 307 $1$is_args$args;
    }
    

    Note that with the regular expression location directive, its order within the configuration is significant, so you may need to move it. See this document for details.

    0 讨论(0)
提交回复
热议问题