反饋已提交
網絡繁忙
用户搭建集群环境后,希望减短访问工程的网址长度,例如:访问 http://192.168.1.23 可直接跳转到 http://192.168.1.23/webroot/decision。
在 nginx 中做短域名的处理,使用 rewrite 指令实现,匹配所有的 / 并 rewrite 重定向到/webroot/decision,如下所示:
server { listen 90; server_name localhost; #匹配/ 转到/webroot/decision上; #^(.*)$表示/后任意部分,除非和其它location匹配否则一律转向/webroot/decision,如果无需这样可以修改这里location或者rewrite的正则; #permanent表示重定向并返回301; location / { rewrite ^(.*)$ /webroot/decision permanent; } location /webroot { proxy_pass http://crm; ...... }}
进入 nginx 安装目录,找到 nginx.conf 文件,本文示例 nginx.conf 文件在/usr/nginx/conf路径下,修改 nginx.conf 文件中的 server { 代码部分,重启 nginx 。
1)具体步骤如下图所示:
2)重启 nginx 。可参考 启动 nginx
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
反馈已提交
网络繁忙