Home  >  Q&A  >  body text

rewrite nginx

http://example.com:8000/image/ -> https://example1.com/

How to write such a redirect?
I triedrewrite ^(/image)$ https://example1.com/ permenant
The result is redirected to https://example1.com/image/

我想大声告诉你我想大声告诉你2713 days ago374

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-16 17:20:16

    server {
        listen       8000;
        ...
    
        location = /image/ {
            proxy_pass https://example1.com/;
        }
    }

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 17:20:16

    If you use openresty, you can take a look at this /a/1190000004680996

    reply
    0
  • Cancelreply