Py学习  »  sktan  »  全部回复
回复总数  1

将默认规则覆盖为仅服务器index_ui.html,则需要为根目录设置特定规则,并使用默认规则将代理还原为正常:

server {
    listen          80;
    server_name     ui.mysite.com ;

    # Location block for specifically URL /
    location = / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass htt://www.mysite.com:2121/index_ui.html;
    }
    # Location block for all other URLs
    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass htt://www.mysite.com:2121;
    }
}