首页 > nginx如何重写或跳转8000端口到443

nginx如何重写或跳转8000端口到443

例如把:

test.domain.com:8000/event/123

跳转到:

https://test.domain.com/event/123

在你8000的server配置里加上下面代码就行

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

server {
  listen    8000;
  server_name test.domain.com;
  return 301 $scheme://test.domain.com$request_uri;
}
【热门文章】
【热门文章】