nginx 访问跳转到二级目录

如访问:http://www.xxx.net 跳转到 http://www.xxx.net/mail

server {
listen 80;
server_name www.xxx.net;
rewrite ^/$ /mail permanent;
client_max_body_size 10m;
location / {
proxy_pass http://webmail-server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header ForwardedFor$proxy_add_x_forwarded_for;
}

}
upstream webmail-server {
server 127.0.0.1:8090;
}

你可能感兴趣的:(nginx)