Home  >  Q&A  >  body text

How to rewrite or jump nginx port 8000 to 443

For example:

test.domain.com:8000/event/123

redirect to:

https://test.domain.com/event/123
高洛峰高洛峰2713 days ago490

reply all(2)I'll reply

  • 黄舟

    黄舟2017-05-16 17:25:53

    Just add the following code to your 8000 server configuration

    rewrite ^/event/123 https://test.domain.com/event/123 permanent;
    

    reply
    0
  • 某草草

    某草草2017-05-16 17:25:53

    server {
      listen    8000;
      server_name test.domain.com;
      return 301 $scheme://test.domain.com$request_uri;
    }
    

    reply
    0
  • Cancelreply