当前位置:网站首页>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
边栏推荐
- [today in history] May 29: the pioneer of sharing software was born; Chromebox launched; VoodooPC founder was born
- Online JSON to plaintext tool
- How does win11 add printers and scanners? Win11 add printer and scanner settings
- isEmpty 和 isBlank 的用法區別
- 【历史上的今天】6 月 6 日:世界 IPv6 启动纪念日;《俄罗斯方块》发布;小红书成立
- 《天天数学》连载53:二月二十一日
- [fuzzy neural network] simulation of fuzzy neural network based on MATLAB
- [today in history] June 1: Napster was founded; MS-DOS original author was born; Google sells Google SketchUp
- Writing based on stm32
- [inverted pendulum control] Simulink simulation of inverted pendulum control based on UKF unscented Kalman filter
猜你喜欢

Mixed programming of C language and assembly language in stm32

How to enable multi language text suggestions? Win11 method to open multilingual text suggestions
![[fuzzy neural network] simulation of fuzzy neural network based on MATLAB](/img/2f/ffe3baf37808b78b2c299aef5a717e.jpg)
[fuzzy neural network] simulation of fuzzy neural network based on MATLAB

Summary of software testing tools in 2021 - fuzzy testing tools

JDBC与MySQL数据库

如何开启多语言文本建议?Win11打开多语言文本建议的方法

【方块编码】基于matlab的图像方块编码仿真

Win11 cannot create a new text document? Solution to win11 right click failure to create a new text document

Get 5 offers after being notified of layoffs

ByteDance Interviewer: how to calculate the memory size occupied by a picture
随机推荐
MFC常用 当前路径
Online text batch inversion by line tool
StaticLayout的使用详解
Publicity of the third batch of shortlisted enterprises! Annual Top100 smart network supplier selection
Get 5 offers after being notified of layoffs
Arduino Esp8266 Web LED控制
[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
在线JSON转PlainText工具
ByteDance Interviewer: how to calculate the memory size occupied by a picture
[today in history] June 20: the father of MP3 was born; Fujitsu was established; Google acquires dropcam
[plug in -statistical] statistics the number of code lines and related data
[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
Win11不能拖拽图片到任务栏软件上快速打开怎么办
Livedata interview question bank and answers -- 7 consecutive questions for livedata interview~
横向滚动的RecycleView一屏显示五个半,低于五个平均分布
Win11不能拖拽圖片到任務欄軟件上快速打開怎麼辦
What if win11 can't drag an image to the taskbar software to open it quickly
无心剑英汉双语诗004.《静心》
Writing C program with GCC and makefile for the first time
如何判断线程池已经执行完所有任务了?