文章目录
- 项目部署
- 学习链接
- 1.安装ffmpeg
- linux centos下安装ffmpeg的详细教程
- 2. springboot + maven 多环境配置文件
- pom.xml
- application.properties
- application-dev.properties
- application-prod.properties
- logback.xml
- 3. 配置nginx
- 配置要点
- nginx配置
- 4. 启动项目
- 5.访问
项目部署
学习链接
linux下安装ffmpeg的详细教程 - 完全参照这个安装的
FFmpeg视频处理入门教程----从安装到使用(Linux版)
linux下ffmpeg安装教程(小学生都能看懂)
文件上传java报Processing of multipart/form-data request failed. java.io.EOFException: Unexpected EOF read
1.安装ffmpeg
linux centos下安装ffmpeg的详细教程
1、下载解压
wget http://www.ffmpeg.org/releases/ffmpeg-3.1.tar.gz
tar -zxvf ffmpeg-3.1.tar.gz
2、 进入解压后目录,输入如下命令/usr/local/ffmpeg为自己指定的安装目录
cd ffmpeg-3.1
./configure --prefix=/usr/local/ffmpeg
make && make install
3、配置变量
vi /etc/profile
在最后PATH添加环境变量:
export PATH=$PATH:/usr/local/ffmpeg/bin
保存退出
查看是否生效
source /etc/profile 设置生效
4、查看版本
ffmpeg -version # 查看版本
注意,若安装过程中出现以下错误
yasm/nasm not found or too old. Use –disable-yasm for a crippled build. If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file “config.log” produced by configure as this will help solve the problem.
需要安装 yasm
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make && make install
2. springboot + maven 多环境配置文件
因为分为本地开发环境 和 正式环境,如果是每次切换环境,还要把配置文件的参数改来改去的话,就太麻烦了,因此使用springboot支持的profile指定多环境配置。
pom.xml
- 需要在maven中使用Profiles标签配置
本地开发dev环境
和线上正式prod环境
,方便使用maven切换环境,并且此时可在application.properties中使用@profileActive@来引用maven选择的环境,让指定的环境的配置文件生效。 - 在build标签下,创建resources标签,再在resource标签下创建resource,将指定环境下的配置文件纳入到打包中(这步可以不做)
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.6.1</version> <relativePath/> </parent> <modelVersion>4.0.0</modelVersion> <groupId>com.easypan</groupId> <artifactId>easypan</artifactId> <version>1.0</version> <packaging>jar</packaging> <name>easypan</name> <description>easypan</description> <properties> <java.version>1.8</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <skipTests>true</skipTests> <springboot.version>2.6.1</springboot.version> <mybatis.version>1.3.2</mybatis.version> <logback.version>1.2.10</logback.version> <mysql.version>8.0.23</mysql.version> <aspectjweaver.version>1.9.4</aspectjweaver.version> <okhttp3.version>3.2.0</okhttp3.version> <fastjson.version>1.2.66</fastjson.version> <commons.lang3.version>3.4</commons.lang3.version> <commons.codec.version>1.9</commons.codec.version> <commons.io.version>2.5</commons.io.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </exclusion> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> </exclusion> </exclusions> </dependency> <!--邮件发送--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> <version>${springboot.version}</version> </dependency> <!--redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>${springboot.version}</version> </dependency> <!--mybatis--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>${mybatis.version}</version> </dependency> <!-- 数据库--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> <!-- 日志版本 --> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>${logback.version}</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>${logback.version}</version> </dependency> <!--切面--> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectjweaver.version}</version> </dependency> <!--okhttp--> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>${okhttp3.version}</version> </dependency> <!--fastjson--> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> <!--apache common--> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>${commons.lang3.version}</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>${commons.codec.version}</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>${commons.io.version}</version> </dependency> </dependencies> <profiles> <profile> <!-- 开发环境 --> <id>dev</id> <properties> <profileActive>dev</profileActive> </properties> <!-- 默认激活的环境 --> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <!-- 生产环境 --> <id>prod</id> <properties> <profileActive>prod</profileActive> </properties> </profile> </profiles> <build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>application-${profileActive}.yml</include> <include>application.yml</include> <include>**/*.xml</include> <include>application.properties</include> <include>application-${profileActive}.properties</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.2.6.RELEASE</version> <executions> <execution> <goals> <goal> repackage </goal> </goals> </execution> </executions> <configuration> <mainClass>com.easypan.EasyPanApplication</mainClass> </configuration> </plugin> </plugins> </build> </project>
application.properties
使用@profileActive@可以引用使用maven选择的环境
#spring.profiles.active=prod
spring.profiles.active=@profileActive@
application-dev.properties
本地开发环境配置
# 应用服务 WEB 访问端口
server.port=7090
server.servlet.context-path=/api
#session过期时间 60M 一个小时
server.servlet.session.timeout=PT60M
#处理favicon
spring.mvc.favicon.enable=false
spring.servlet.multipart.max-file-size=15MB
spring.servlet.multipart.max-request-size=15MB
#错误页处理
spring.mvc.throw-exception-if-no-handler-found=true
spring.web.resources.add-mappings=false
#数据库配置
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/easypan?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.hikari.pool-name=HikariCPDatasource
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.idle-timeout=180000
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1
#发送邮件配置相关
# 配置邮件服务器的地址 smtp.qq.com
spring.mail.host=smtp.qq.com
# 配置邮件服务器的端口(465或587)
spring.mail.port=587
# 配置用户的账号
spring.mail.username=1255112011@qq.com
# 配置用户的密码
spring.mail.password=填入自己的授权码
# 配置默认编码
spring.mail.default-encoding=UTF-8
# SSL 连接配置
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
# 开启 debug,这样方便开发者查看邮件发送日志
spring.mail.properties.mail.debug=true
#邮件配置结束
#Spring redis配置
# Redis数据库索引(默认为0)
spring.redis.database=0
spring.redis.host=127.0.0.1
spring.redis.port=6379
# 连接池最大连接数(使用负值表示没有限制)
spring.redis.jedis.pool.max-active=20
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.jedis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.jedis.pool.max-idle=10
# 连接池中的最小空闲连接
spring.redis.jedis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.timeout=2000
#项目目录
project.folder=D:/document/easypan/easypan-java/
#日志级别配置
log.root.level=info
#超级管理员id
admin.emails=1255112011@qq.com
#是否是开发环境
dev=true
##qq登陆相关##
qq.app.id=123456
qq.app.key=123456
qq.url.authorization=https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=%s&redirect_uri=%s&state=%s
qq.url.access.token=https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=%s&client_secret=%s&code=%s&redirect_uri=%s
qq.url.openid=https://graph.qq.com/oauth2.0/me?access_token=%S
qq.url.user.info=https://graph.qq.com/user/get_user_info?access_token=%s&oauth_consumer_key=%s&openid=%s
qq.url.redirect=http://easypan.wuhancoder.com/qqlogincalback
application-prod.properties
# 应用服务 WEB 访问端口
server.port=7091
server.servlet.context-path=/api
#session过期时间 60M 一个小时
server.servlet.session.timeout=PT60M
#处理favicon
spring.mvc.favicon.enable=false
spring.servlet.multipart.max-file-size=15MB
spring.servlet.multipart.max-request-size=15MB
#错误页处理
spring.mvc.throw-exception-if-no-handler-found=true
spring.web.resources.add-mappings=false
#数据库配置
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/easypan?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=数据库密码
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.hikari.pool-name=HikariCPDatasource
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.idle-timeout=180000
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1
#发送邮件配置相关
# 配置邮件服务器的地址 smtp.qq.com
spring.mail.host=smtp.qq.com
# 配置邮件服务器的端口(465或587)
spring.mail.port=587
# 配置用户的账号
spring.mail.username=1255112011@qq.com
# 配置用户的密码
spring.mail.password=填入自己的授权码
# 配置默认编码
spring.mail.default-encoding=UTF-8
# SSL 连接配置
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
# 开启 debug,这样方便开发者查看邮件发送日志
spring.mail.properties.mail.debug=true
#邮件配置结束
#Spring redis配置
# Redis数据库索引(默认为0)
spring.redis.database=0
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=填写redis密码
# 连接池最大连接数(使用负值表示没有限制)
spring.redis.jedis.pool.max-active=20
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.jedis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.jedis.pool.max-idle=10
# 连接池中的最小空闲连接
spring.redis.jedis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.timeout=2000
#项目目录
project.folder=/usr/local/blog/easypan/backend/
#日志级别配置
log.root.level=info
#超级管理员id
admin.emails=1255112011@qq.com
#是否是开发环境
dev=true
##qq登陆相关##
qq.app.id=123456
qq.app.key=123456
qq.url.authorization=https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=%s&redirect_uri=%s&state=%s
qq.url.access.token=https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=%s&client_secret=%s&code=%s&redirect_uri=%s
qq.url.openid=https://graph.qq.com/oauth2.0/me?access_token=%S
qq.url.user.info=https://graph.qq.com/user/get_user_info?access_token=%s&oauth_consumer_key=%s&openid=%s
qq.url.redirect=http://easypan.wuhancoder.com/qqlogincalback
logback.xml
<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true" scanPeriod="10 minutes">
<appender name="stdot" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n</pattern>
</layout>
</appender>
<springProperty scope="context" name="log.path" source="project.folder"/>
<springProperty scope="context" name="log.root.level" source="log.root.level"/>
<property name="LOG_FOLDER" value="logs"/>
<property name="LOG_FILE_NAME" value="easypan.log"/>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${log.path}/${LOG_FOLDER}/${LOG_FILE_NAME}.%d{yyyyMMdd}.%i</FileNamePattern>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
<TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<MaxFileSize>20MB</MaxFileSize>
</TimeBasedFileNamingAndTriggeringPolicy>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<charset>utf-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss,GMT+8} [%p][%c][%M][%L]-> %m%n</pattern>
</encoder>
<append>false</append>
<prudent>false</prudent>
</appender>
<root level="${log.root.level}">
<appender-ref ref="stdot"/>
<appender-ref ref="file"/>
</root>
</configuration>
3. 配置nginx
配置要点
有两个东西需要配置:
-
网盘的前端项目访问 和 后台接口请求转发 配置
-
文件上传配置参数(遇到过问题:上传到5M的时候,就停了,然后报错如下。本地是可以上传超过5M的,因此怀疑是nginx的配置相关的问题,可参考这篇解决:文件上传java报Processing of multipart/form-data request failed. java.io.EOFException: Unexpected EOF read
Caused by: java.io.IOException: org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException: Processing of multipart/form-data request failed. java.io.EOFException at org.apache.catalina.connector.Request.parseParts(Request.java:2966) at org.apache.catalina.connector.Request.getParts(Request.java:2823) at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1098) at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:95) ... 43 common frames omitted Caused by: org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException: Processing of multipart/form-data request failed. java.io.EOFException at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:292) at org.apache.catalina.connector.Request.parseParts(Request.java:2921) ... 46 common frames omitted Caused by: org.apache.catalina.connector.ClientAbortException: java.io.EOFException at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:322) at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:600) at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:340) at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:132) at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:975) at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:879) at java.io.InputStream.read(InputStream.java:101) at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:97) at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:288) ... 47 common frames omitted Suppressed: org.apache.catalina.connector.ClientAbortException: java.io.EOFException at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:322) at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:600) at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:340) at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:132) at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:975) at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.close(MultipartStream.java:919) at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.close(MultipartStream.java:898) at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:117) ... 48 common frames omitted Caused by: java.io.EOFException: null at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1294) at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1206) at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:805) at org.apache.coyote.http11.Http11InputBuffer.access$400(Http11InputBuffer.java:42) at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1172) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:101) at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:249) at org.apache.coyote.Request.doRead(Request.java:640) at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:317) ... 55 common frames omitted Caused by: java.io.EOFException: null at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1294) at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1206) at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:805) at org.apache.coyote.http11.Http11InputBuffer.access$400(Http11InputBuffer.java:42) at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1172) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:101) at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:249) at org.apache.coyote.Request.doRead(Request.java:640) at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:317) ... 55 common frames omitted
nginx配置
./sbin/nginx -t 检查nginx配置文件是否有语法错误
./sbin/nginx -s reload 当修改完nginx配置文件后,重新载入配置文件
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
client_max_body_size 50m;
client_body_buffer_size 5M;
client_header_timeout 1m;
client_body_timeout 1m;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 4;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
server {
listen 80;
server_name 119.23.61.24;
location / {
root /usr/local/blog/bootblog/web/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location ^~ /api/ {
proxy_pass http://119.23.61.24:9091/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 81;
server_name 119.23.61.24;
## 个人博客前端项目
location / {
root /usr/local/blog/bootblog/admin/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
## 个人博客后台接口
location ^~ /api/ {
proxy_pass http://119.23.61.24:9091/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /img/ {
root /usr/local/blog/bootblog/res/img/;
autoindex on;
autoindex_exact_size off;
autoindex_format html;
autoindex_localtime on;
}
}
server {
listen 82;
server_name 119.23.61.24;
location / {
proxy_pass http://119.23.61.24:8080/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 83;
server_name 119.23.61.24;
location / {
root /usr/local/blog/bootblog/res/img/;
autoindex on;
index a.html; #指明index文件,默认为index.html,如果此文件不存在,访问域名时会显示目录结构
autoindex_exact_size off;
autoindex_format json; #指明返回的为json格式,也可以是html格式
autoindex_localtime on;
}
}
server {
listen 7090;
server_name 119.23.61.24;
## 网盘前端项目
location / {
root /usr/local/blog/easypan/web/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
## 后台接口请求转发
location ^~ /api/ {
proxy_pass http://localhost:7091; ## 注意这里的7091后面没有带/,所以匹配到的请求的请求路径/api/xxx都会拼接到7091后面去,即形成了http://localhost:7091/api/xxx
## 添加如下的配置,否则会出现上传超过5M就报错了
client_max_body_size 500m;
proxy_max_temp_file_size 1024m;
#client_header_buffer_size 24k;
client_body_buffer_size 24k;
#client_max_body_size 200m;
client_body_timeout 3600s;
client_body_temp_path /temp;
resolver_timeout 3600s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
4. 启动项目
nohup java -jar easypan.jar > /dev/null &
ps -ef|grep java # 查看是否起来了
netstat -anp |grep 7091 # 查看端口是否占用了
5.访问
访问即可:http://119.23.61.24:7090/login