直接在application.properties配置。参见官网说明(Part X. Appendices)
#Network address to which the server should bind to.
server.address=
#If response compression is enabled(tomcat: compression="on").
server.compression.enabled=true
#List of user-agents to exclude from compression(tomcat: noCompressionUserAgents="gozilla,traviata").
server.compression.excluded-user-agents=gozilla,traviata
#Comma-separated list of MIME types that should be compressed.
#For instance `text/html,text/css,application/json` (tomcat: compressableMimeType="text/html,text/xml,text/plain,text/css,application/json").
server.compression.mime-types=text/html,text/xml,text/plain,text/css,application/json
#Minimum response size that is required for compression to be performed.
#For instance 2048(tomcat: compressionMinSize="2048")
server.compression.min-response-size=2048
#Time in milliseconds that connectors will wait for another HTTP request before closing the connection. When not set, the connector's container-specific default will be used.
#Use a value of -1 to indicate no (i.e. infinite) timeout. (tomcat: connectionTimeout="20000")
server.connection-timeout=20000
#Servlet context init parameters. For instance `server.context-parameters.a=alpha`
server.context-parameters.*=
#Context path of the application.
server.context-path=
#Server HTTP port.
server.port=8080
#Display name of the application.
server.display-name=application
#Maximum size in bytes of the HTTP message header.
server.max-http-header-size=0
#Maximum size in bytes of the HTTP post content.
server.max-http-post-size=0
#When to include a "stacktrace" attribute.
server.error.include-stacktrace=never
#Path of the error controller.
server.error.path=/error
#Enable the default error page displayed in browsers in case of a server error.
server.error.whitelabel.enabled=true
#Number of acceptor threads to use.
server.jetty.acceptors=
#Number of selector threads to use.
server.jetty.selectors=
#The class name of the JSP servlet.
server.jsp-servlet.class-name=org.apache.jasper.servlet.JspServlet
#Init parameters used to configure the JSP servlet
server.jsp-servlet.init-parameters.*=
#Whether or not the JSP servlet is registered
server.jsp-servlet.registered=true
#Value to use for the Server response header (no header is sent if empty)
server.server-header=
#Path of the main dispatcher servlet.
server.servlet-path=/
#If X-Forwarded-* headers should be applied to the HttpRequest.
server.use-forward-headers=
#Comment for the session cookie.
server.session.cookie.comment=
#Domain for the session cookie.
server.session.cookie.domain=
#"HttpOnly" flag for the session cookie.
server.session.cookie.http-only=
#Maximum age of the session cookie in seconds.
server.session.cookie.max-age=
#Session cookie name.
server.session.cookie.name=
#Path of the session cookie.
server.session.cookie.path=
#"Secure" flag for the session cookie.
server.session.cookie.secure=
#Persist session data between restarts.
server.session.persistent=false
#Directory used to store session data.
server.session.store-dir=
#Session timeout in seconds.
server.session.timeout=
#Session tracking modes (one or more of the following: "cookie", "url", "ssl").
server.session.tracking-modes=
#Supported SSL ciphers.
server.ssl.ciphers=
#Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store.
server.ssl.client-auth=
#Enable SSL support.
server.ssl.enabled=
#Enabled SSL protocols.
server.ssl.enabled-protocols=
#Alias that identifies the key in the key store.
server.ssl.key-alias=
#Password used to access the key in the key store.
server.ssl.key-password=
#Path to the key store that holds the SSL certificate (typically a jks file).
server.ssl.key-store=
#Password used to access the key store.
server.ssl.key-store-password=
#Provider for the key store.
server.ssl.key-store-provider=
#Type of the key store.
server.ssl.key-store-type=
#SSL protocol to use.
server.ssl.protocol=TLS
#Trust store that holds SSL certificates.
server.ssl.trust-store=
#Password used to access the trust store.
server.ssl.trust-store-password=
#Provider for the trust store.
server.ssl.trust-store-provider=
#Type of the trust store.
server.ssl.trust-store-type=
#Directory in which log files are created. Can be relative to the tomcat base dir or absolute.
server.tomcat.accesslog.directory=logs
#Enable access log.
server.tomcat.accesslog.enabled=false
#Format pattern for access logs.
server.tomcat.accesslog.pattern=common
#Log file name prefix.
server.tomcat.accesslog.prefix=access_log
#Defer inclusion of the date stamp in the file name until rotate time.
server.tomcat.accesslog.rename-on-rotate=false
#Log file name suffix.
server.tomcat.accesslog.suffix=.log
#Delay in seconds between the invocation of backgroundProcess methods.
server.tomcat.background-processor-delay=30
#Tomcat base directory. If not specified a temporary directory will be used.
server.tomcat.basedir=
#regular expression matching trusted IP addresses.
server.tomcat.internal-proxies=10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|\\192\\.168\\.\\d{1,3}\\.\\d{1,3}|\\ 169\\.254\\.\\d{1,3}\\.\\d{1,3}|\\ 127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|\\ 172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|\\ 172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|\\ 172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}
#Maximum amount of worker threads.
server.tomcat.max-threads=0
#Minimum amount of worker threads.
server.tomcat.min-spare-threads=0
#Name of the HTTP header used to override the original port value.
server.tomcat.port-header=X-Forwarded-Port
#Header that holds the incoming protocol, usually named "X-Forwarded-Proto".
server.tomcat.protocol-header=
#Value of the protocol header that indicates that the incoming request uses SSL.
server.tomcat.protocol-header-https-value=https
#Whether requests to the context root should be redirected by appending a / to the path.
server.tomcat.redirect-context-root=
#Name of the http header from which the remote ip is extracted. For instance `X-FORWARDED-FOR`
server.tomcat.remote-ip-header=
#Character encoding to use to decode the URI.
server.tomcat.uri-encoding=UTF-8
相关推荐
2. **修改 `server.xml` 文件**:编辑 Tomcat 的 `server.xml` 文件,在 `<Connector>` 元素中添加 SSL 相关配置。 ```xml maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth=...
在IT行业中,SpringBoot是一个非常流行的Java框架,它简化了创建独立、生产级别的基于Spring的应用程序。本示例将向你展示如何将一个简单的SpringBoot应用部署到外部的Tomcat服务器上,这对于开发者来说是一项基本但...
在现代Web开发中,SpringBoot和Vue.js的组合已经成为一种非常流行的技术栈,它们能够实现高效、快速的前后端分离应用。SpringBoot简化了Java Web应用程序的开发,而Vue.js则是一个轻量级且功能强大的前端框架,适用...
在IT行业中,SpringBoot和Maven是两个非常关键的框架,它们被广泛应用于构建现代Java应用程序,特别是Web应用。SpringBoot简化了Spring框架的配置,而Maven则负责项目的构建和依赖管理。在这个"SpringBoot+Maven(SSM...
在本文中,我们详细介绍了Spring Boot应用程序的Properties配置,包括配置文件、Profiles、应用程序设置、日志记录、身份认证、嵌入式服务器配置、SSL/TLS配置和Tomcat配置等方面。了解这些配置项,可以帮助开发者更...
在本文中,我们将深入探讨如何将一个SpringBoot应用部署到中创AS(InforSuite Application Server)。首先,我们需要了解SpringBoot本身是一个简化Java web应用开发的框架,通常以jar包形式运行。然而,为了在AS上...
在SpringBoot中,我们可以通过实现WebFlux的`HandlerFunction`或者`WebFilter`来定义Netty的路由和处理逻辑。Netty Server端通常会包含一个`ServerBootstrap`,用于设置服务器的各种属性,如事件循环组、通道处理器...
在Spring Boot框架中,开发者可以选择不同的嵌入式Web服务器作为应用程序的容器,其中最常见的是Tomcat和Jetty。本文将深入探讨如何在Spring Boot项目中从Tomcat切换到Jetty容器,以及这两个容器的特点和使用场景。 ...
SpringBoot框架是一款流行的Java Web开发框架,但是在实际开发中,开发者经常会遇到乱码问题,导致项目无法正常运行。为了解决这个问题,本文将详细介绍SpringBoot乱码问题解决方案,并提供详细的示例代码和配置方法...
本篇文章将详细讲解如何利用 SpringBoot 搭建一个支持 JSP(JavaServer Pages)的 Web 应用。 1. **Spring Initializr 初始化项目** - 访问 [Spring Initializr](https://start.spring.io/) 网站,选择 Maven 或 ...
`spring-boot-starter-web`是SpringBoot提供的一个starter依赖,它包含了开发Web应用所需的所有基础依赖,例如Spring MVC、Tomcat服务器、Jackson JSON处理器等。 3. **添加Maven插件:** ```xml ...
Context 是 Tomcat 服务器中的一种虚拟主机,可以用来配置应用程序的部署路径和名称。在 server.xml 文件中,我们添加了一个新的 Context,如下所示: ```xml <Context path="/bbsb" docBase="D:\\apache-tomcat-...
SpringBoot中使用的内置web容器是Tomcat、Jetty、Undertow三种容器之一,用于启动和部署web应用程序。这些容器都可以作为SpringBoot应用程序的内置容器,提供了一个简洁的开发体验。 Tomcat容器 Tomcat是最常用...
这两份文档详细地介绍了SpringBoot的配置、启动流程、自动配置机制、内嵌Web服务器(如Tomcat或Jetty)、健康检查、Actuator监控工具、数据访问、集成各种服务(如Redis、MyBatis、JPA等)以及如何创建可执行的JAR等...
本文将深入探讨SpringBootWeb请求响应的处理机制,以及相关技术如HTML、CSS和JavaScript在Web开发中的角色。 1. Web开发基础 Web开发涵盖了网页设计和动态内容的创建。微软定义Web开发为使用HTML、CSS和JavaScript...
- **嵌入式Web服务器(Embedded Web Server)**:SpringBoot可以内嵌Tomcat、Jetty等Web服务器,这样你无需打包成WAR文件,可以直接运行JAR文件。 - **运行器(Runner)**:SpringBoot提供`CommandLineRunner`和`...
而Apache Tomcat是一款开源的Web服务器和Servlet容器,广泛用于部署Java Web应用。本资源"springboot部署到外部tomcat容器.rar"显然是关于如何将Spring Boot应用部署到外部的Tomcat服务器上的教程。下面,我们将深入...
SpringBoot还提供了内置的Tomcat服务器,使得应用可以直接运行在内嵌的容器中,无需额外配置。理解如何通过`server`配置项调整服务器参数,如端口、上下文路径、连接器设置等,对优化服务性能至关重要。 另外,...
- Spring Boot是Spring Cloud的基础,可以轻松构建分布式系统,如服务发现(Eureka)、熔断机制(Hystrix)、配置中心(Config Server)等。 以上就是基于Spring Boot创建Web项目的基本知识点,实际开发中还需要...