spring boot之端口设置和contextpath的配置
来源:互联网 发布:js解析url中的参数 编辑:程序博客网 时间:2024/05/21 06:36
端口设置
Spring boot 默认端口是8080,如果想要进行更改的话,只需要修改applicatoin.properties文件,在配置文件中加入:
1
server.port=
9090
常用配置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
########################################################
###EMBEDDED SERVER CONFIGURATION (ServerProperties)
########################################################
#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to '/'
#server.context-path=/spring-boot
#server.servlet-path= # the servlet path, defaults to '/'
#server.tomcat.access-log-pattern= # log pattern of the access log
#server.tomcat.access-log-enabled=false # is access logging enabled
#server.tomcat.protocol-header=x-forwarded-proto # ssl forward headers
#server.tomcat.remote-ip-header=x-forwarded-for
#server.tomcat.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#server.tomcat.background-processor-delay=30; # in seconds
#server.tomcat.max-threads = 0 # number of threads in protocol handler
#server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding
ContextPath配置
Spring boot默认是/ ,这样直接通过http://ip:port/就可以访问到index页面,如果要修改为http://ip:port/path/ 访问的话,那么需要在Application.properties文件中加入server.context-path = /你的path,比如:spring-boot,那么访问地址就是http://ip:port/spring-boot 路径。
1
server.context-path=/spring-boot
常用配置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
########################################################
###EMBEDDED SERVER CONFIGURATION (ServerProperties)
########################################################
#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to '/'
#server.context-path=/spring-boot
#server.servlet-path= # the servlet path, defaults to '/'
#server.tomcat.access-log-pattern= # log pattern of the access log
#server.tomcat.access-log-enabled=false # is access logging enabled
#server.tomcat.protocol-header=x-forwarded-proto # ssl forward headers
#server.tomcat.remote-ip-header=x-forwarded-for
#server.tomcat.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#server.tomcat.background-processor-delay=30; # in seconds
#server.tomcat.max-threads = 0 # number of threads in protocol handler
#server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding
阅读全文
0 0
- spring boot之端口设置和contextpath的配置
- Spring Boot 配置ContextPath
- 11. 配置ContextPath【从零开始学Spring Boot】
- 11. 配置ContextPath【从零开始学Spring Boot】
- Spring Boot 学习18--配置ContextPath
- (11)Spring Boot配置ContextPath【从零开始学Spring Boot】
- spring-boot设置内置启动的tomcat端口
- Spring boot之默认首页的设置
- spring boot 内置tomcat端口设置
- spring boot设置http https端口
- spring Boot 设置tomcat端口号
- Spring Boot之自动配置的原理
- SSL证书和spring boot的配置
- spring boot 获取端口和 Ip
- Spring boot 工程设置上下文路径时的 Websocket 配置
- Spring boot项目 使用ip+port+contextPath进行访问的时候会直接显示出项目中的一些接口信息和相关数据
- Spring Boot 之Maven配置
- Spring Boot之日志配置
- 类似cout<<a[len1--]<<endl;这样子的表达形式探秘
- bzoj 1412
- Developer Notification (set struts.devMode to false to disable this message)报错
- 实验吧奇怪的字符串
- kotlin.jvm.internal.FunctionReference与Kotlin-kapt插件使用
- spring boot之端口设置和contextpath的配置
- 让java从Mysql返回多个ResultSet
- 欧拉线性筛模板
- 用邻接矩阵求无向图的连同分支数
- mysql数据库存储过程(细)-------游标的应用
- html css伪元素选择器
- 从输入网址到返回页面经过了这些过程
- Professional JS(13.4.7HTML5 /device/Touch/Gesture Event/Memory&Performance/Simulating Events/Canvas)
- 【死磕Java并发】-----J.U.C之阻塞队列:PriorityBlockingQueue