所以基本上我必须代理通过Web服务器的根@
/
但应用程序托pipe在
/ui
当他们没有手动input/ ui时,他们就会出现在服务器的主页上,这是静态的,没有被使用。 我想最初让Nginx把你移到domain.com/ui当你键入domain.com,然后基本上做它通常做的事,代理应用程序。
我把它放在我的https服务器块,它redirect给定的url,在这个例子中https://subdomain.domain.com到https://subdomain.domain.com/ui,并发送一个永久的标志到远程浏览器供将来参考/速度。 我认为这是至less为什么
rewrite ^/$ /ui permanent;
要么
rewrite ^/$ /path permanent;
完整configuration:
server { listen 80; server_name subdomain.domain.com; return 301 https://$server_name/; } server { listen 443 ssl; server_name subdomain.domain.com; rewrite ^/$ /ui permanent; location / { proxy_pass stuff } }
尝试这样的事情 – 我不能保证它会起作用,但是值得一试。 基本上是说“发送UI文件夹的请求到这个其他的服务器”。 您也可能需要在其他答案中重写。
location /ui { proxy_pass (etc); }