修改/etc/nginx/sites-available/default
server {
listen 80;
server_name example1.com;
return 301 https://example2.com$request_uri;
}
列出目录下的文件
server_name _;
autoindex on;
autoindex_exact_size off;
autoindex_format html;
autoindex_localtime on;
之后
sudo nginx -s reload