当前位置:网站首页>Le routage des microservices de la passerelle a échoué au chargement des ressources statiques des microservices
Le routage des microservices de la passerelle a échoué au chargement des ressources statiques des microservices
2022-06-28 02:56:00 【Un rêve nuageux revient à distance】
GatewayLe routage des microservices a échoué à charger les ressources statiques des microservices
1.Gateway
1.1 GatewayIntroduction
- GatewayC'est le microservice Gateway,Fournir un accès uniforme à nos grappes de microservices,Assertion basée sur la correspondance de routage,Accès aux microservices correspondants
2.Gateway Avant et après le succès
2.1 Le scénario de défaillance des ressources statiques réapparaît
- Chemin de ressources statiques introduit sur la page des microservices distants,/css/index.css
<!-- Introduction de l'extérieur Fichiers de style -->
<link rel="stylesheet" type="text/css" href="../static/css/index.css" th:href="@{/css/index.css}">

- Les microservices distants libèrent des ressources statiques,Modifier le profil
spring:
application:
name: ProductPageDemo
# Libérer les ressources statiques
resources:
static-locations: classpath:/static/
- GatewayProfil de la passerelle
server:
port: 80
spring:
application:
name: GatewayDemo
cloud:
gateway:
# Configurer le routage
routes:
- id: ProductPageDemo
uri: http://ProductPageDemo:9100
predicates:
# Assertion,Par /page/ Début de la correspondance
- Path=/page/**
filters:
# Filtre, Les chemins de premier niveau sont supprimés et routés
- StripPrefix=1
- Faire une demande:http://127.0.0.1/page/page/all

2.2 Modification réussie,Chargement réussi
- Parce que ma correspondance de routage nécessite de supprimer le chemin de correspondance de premier niveau ,Donc nous avons besoin de Modifier le chemin de la ressource statique lorsque le micro - service correspondant introduit la ressource statique ,/page/css/index.css
<!-- Introduction de l'extérieur Fichiers de style -->
<link rel="stylesheet" type="text/css" href="../static/css/index.css" th:href="@{/page/css/index.css}">
- Faire une demande:http://127.0.0.1/page/page/all

2.3 Si le chemin de premier niveau n'est pas supprimé , Vous pouvez configurer comme suit
server:
port: 80
spring:
application:
name: GatewayDemo
cloud:
gateway:
# Configurer le routage
routes:
- id: ProductPageDemo
uri: http://ProductPageDemo:9100
predicates:
# Assertion,Par /page/ Début de la correspondance
- Path=/page/**,/css/** # Libérer le chemin de la ressource statique
边栏推荐
- 【历史上的今天】6 月 8 日:万维网之父诞生;PHP 公开发布;iPhone 4 问世
- Which securities platform is the best and safest for a novice to open a stock trading account
- 【二维码图像矫正增强】基于MATLAB的二维码图像矫正增强处理仿真
- 【历史上的今天】6 月 19 日:iPhone 3GS 上市;帕斯卡诞生;《反恐精英》开始测试
- Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)
- Interview: is bitmap pixel memory allocated in heap memory or native
- [today in history] June 3: Microsoft launched Bing search engine; Larry Roberts starts ARPANET; The father of Visual Basic was born
- Usage details of staticlayout
- [today in history] June 13: parent-child disputes in packet switched networks; The founder of game theory was born; The embryonic form of interactive television
- 初始线性回归
猜你喜欢

分布式事务—基于消息补偿的最终一致性方案(本地消息表、消息队列)

Mixed programming of C language and assembly language in stm32
![[today in history] June 11: the co inventor of Monte Carlo method was born; Google launched Google Earth; Google acquires waze](/img/eb/147d4aac20639d50b204dcf424c9e2.png)
[today in history] June 11: the co inventor of Monte Carlo method was born; Google launched Google Earth; Google acquires waze

微信小程序中生成二维码
![[today in history] June 23: Turing's birthday; The birth of the founder of the Internet; Reddit goes online](/img/d5/4b3e622ab77bc546ca5d285ef67d8a.jpg)
[today in history] June 23: Turing's birthday; The birth of the founder of the Internet; Reddit goes online

Opencv -- Hough transform and some problems encountered

Opencv -- geometric space transformation (affine transformation and projection transformation)

Opencv——霍夫变换以及遇到的一些问题

【二維碼圖像矯正增强】基於MATLAB的二維碼圖像矯正增强處理仿真

Writing C program with GCC and makefile for the first time
随机推荐
Step by step interpretation of crf+bilstm code
How to enable multi language text suggestions? Win11 method to open multilingual text suggestions
Online text batch inversion by line tool
Opencv -- geometric space transformation (affine transformation and projection transformation)
ByteDance Interviewer: how to calculate the memory size occupied by a picture
[today in history] June 24: Netease was established; The first consumer electronics exhibition was held; The first webcast in the world
[today in history] June 12: the United States entered the era of digital television; Mozilla's original developer was born; 3com merges with American Robotics
Design e-commerce seckill system
Win11如何关闭最近打开项目?Win11关闭最近打开项目的方法
How does win11 close recently opened projects? Win11 method to close recently opened projects
[today in history] June 23: Turing's birthday; The birth of the founder of the Internet; Reddit goes online
【历史上的今天】6 月 17 日:术语“超文本”的创造者出生;Novell 首席科学家诞生;探索频道开播
[today in history] June 7: kubernetes open source version was released; Worldofwarcraft landed in China; Birth of the inventor of packet switching network
Flask Foundation: template inheritance + static file configuration
如何判断线程池已经执行完所有任务了?
A low-cost method to increase private domain traffic with simple maintenance
转载文章:数字经济催生强劲算力需求 英特尔发布多项创新技术挖掘算力潜能
抓包整理外篇fiddler————了解工具栏[一]
How fiddle uses agents
字节跳动面试官:一张图片占据的内存大小是如何计算