我正在尝试使用入口路由来使用一个公共 IP 地址部署多个 ReactJS 应用程序。使用https://github.com/pankajladhar/speedy-math.git以下路由文件提供的 SpeedyMath 应用程序尝试访问此应用程序,因为http://myapps.centralus.cloudapp.azure.com/speedymath显示白屏。从浏览器日志中我看到的是http://myapps.centralus.cloudapp.azure.com/static/js/bundle.js net::ERR_ABORTED 404 (Not Found). 我注意到 index.html 已加载但错误“无法加载资源”在行<script type="text/javascript" src="/static/js/bundle.js"></script></body>
入口路由.yml:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myapps-ingress
annotations:
nginx.org/server-snippet: "proxy_ssl_verify off;"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /speedymath
backend:
serviceName: speedymath-service
servicePort: 80
Run Code Online (Sandbox Code Playgroud)
当路由文件更新为从“/speedymath”到“/”的路径时,相同的应用程序会正确加载。但这并不能帮助我根据传入的 url 构建不同的路由规则
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myapps-ingress
annotations:
nginx.org/server-snippet: "proxy_ssl_verify off;"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: speedymath-service
servicePort: 80
Run Code Online (Sandbox Code Playgroud)
在这里感谢您的帮助
我正在尝试构建一个工作流程,其中第一个剧本在 Windows 主机上运行,设置一些变量,其中包含正在执行的所有主机名\xe2\x80\x99s。第二个剧本应该读取这个变量并在 Unix 中使用 Windows 主机名创建一个目录。
\n尝试set_stats在第一个剧本中使用,但变量与所有主机名连接在一起,并且在 Unix 上使用大字符串创建了一个目录。
任何解决方法或建议来实现这一目标。
\nPlaybook 在 Windows 上运行
\n- name: set hostname in a variable \n set_stats: \n data: \n current_hostname: "{{ ansible_hostname }}" \n per_host: no \nRun Code Online (Sandbox Code Playgroud)\nPlaybook 在 Unix 上运行:
\n- name: Creates UNIX directory \n file: \n path: "{{ ARCH_DIR_LOC + current_hostname + \'/\'}}" \n state: directory \n mode: 0777 \nRun Code Online (Sandbox Code Playgroud)\n