Deploy Spring Boot and Vue Applications on Baota Panel with HTTPS

Backend Packaging Notes

Configure proxy bypass in the backend to allow specific domain access. Write two allowed domains: your configured domain and the server IP address. During frontend development, ports are used; in production, omit ports to avoid lock-in.

application.yml Configuration

server:
  port: 9999
  servlet:
    context-path: /api
  ssl:
    enabled: true
    key-store: classpath:your-keystore.pfx
    key-store-password: your-password
    key-store-type: PKCS12
  • port: Keep the same value used during development.
  • context-path: Add /api to avoid conflicting with the frontend's root patth.
  • ssl: Download the SSL certificate from your cloud provider (Tomcat format), place it in resources, and set the password from the accompanying .txt file.

Database Setings

If you developed using a cloud database, no changes are needed. For local databases, update localhost to the server IP and provide the correct credentials.

Creating the JAR

Run Maven lifecycle package (or clean then package). The resulting .jar file is in the target directory (not the .jar.original).


Domain and SSL Configuration on Baota

  1. In the Website section of Baota, add a new PHP site with your domain.
  2. Open site settings → SSL, upload your SSL certificate and private key.
  3. In SecurityFirewall, allow the backend port (e.g., 9999). Also open the port in your cloud provider's security group.

Start the Backend

Upload the JAR to the website's root directory. Connect via terminal:

# Check existing Java processes
jps
# Kill if needed
kill <PID>

# Test run
java -jar your-app.jar

# Persistent run in background
nohup java -jar your-app.jar &
exit

Verify with Swagger at https://yourdomain:9999/api/swagger-ui.html.


Build the Frontend

Use vue-admin-template; it has two build modes:

  • Staging: npm run build:stage (uses .env.staging)
  • Production: npm run build:prod (uses .env.production)

Set the API base URL:

VUE_APP_BASE_API = 'https://yourdomain.com:9999/api'

If static asset paths are incorrect, udpate vue.config.js:

publicPath: './'

After building, the dist folder contains index.html, a directory, and icons. Upload all of them to the same root directory where the JAR resides, replacing any default HTML files.


Nginx Reverse Proxy (via Baota)

In the site's Configuration (not the main nginx config), add these location blocks:

location / {
    try_files $uri $uri/ /index.html;
}

location /api/ {
    proxy_pass https://127.0.0.1:9999;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

The first block serves the frontend's static files; the second proxies API requests to the backend. Without the /api context path in the backend, the proxy would require more complex rewriting.

Once configured, your domain should be accessible over HTTPS.

Tags: Spring Boot vue Baota Panel HTTPS deployment

Posted on Thu, 09 Jul 2026 16:46:33 +0000 by rimelta