Skip to content

houxinlin/one-blog-server

Repository files navigation

OneBlog-Server

部署

  1. 下载
git clone https://github.com/houxinlin/OneBlog-Server.git
  1. 修改配置文件

/src/main/resources/中创建application-prod.properties文件,内容是数据库配置

spring.datasource.url=jdbc:mysql://xxxx:3306/db_blog
spring.datasource.username=root
spring.datasource.password=12345678
  1. 在数据库中导入src/main/resources/sql/db_blog.sql

  2. 打包

./gradlew  bootJar 
  1. 运行
nohup java -jar OneBlog.jar & 
  1. 配置Nginx
server{
	charset utf-8;
	listen 6060;
	server_name xxxxx;

        location / {
           root /var/www/blog/dist/;
           try_files $uri $uri/ @router;
           index  index.html index.htm;
        }
        location @router {
           rewrite ^.*$ /index.html last;
        }

}

  1. 后端代理
location /OneBlog/ {
        proxy_set_header Host $host;
        proxy_set_header x-real-ip $remote_addr;
        proxy_set_header X-Real-Port $remote_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:8087/OneBlog/;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages