# 部署1 **Repository Path**: aigc-win-thoroughly/deployment-1 ## Basic Information - **Project Name**: 部署1 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-06-18 - **Last Updated**: 2024-06-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## javaweb项目 ```bash # 假设 服务器ip地址为 192.168.65.253 # 修改成 ip、域名均可以 # 前端 文件修改 ## webdemo/vue.config.js target: 'https://192.168.65.253', ## webdemo/src/main.js axios.defaults.baseURL = 'https://192.168.65.253' # 后端 文件修改 ## pets_java/src/main/java/com/example/pets_java/config/WebConfig.java .allowedOriginPatterns("http://192.168.65.253") .allowedOriginPatterns("https://192.168.65.253") ## pets_java/src/main/java/com/example/pets_java/config/SecurityConfig.java config.addAllowedOrigin("https://192.168.65.253"); config.addAllowedOrigin("http://192.168.65.253"); # nginx 文件修改 ## nginx/nginx.conf add_header 'Access-Control-Allow-Origin' 'https://192.168.65.253'; rewrite ^(.*)$ https://192.168.65.253$1 permanent; ## 如需https访问 nginx/nginx.conf设置 ## 并且在nginx/certs文件夹放置证书文件 ssl_certificate certs/test.crt; ssl_certificate_key certs/test.key; ## 启动项目 docker-compose up --build -d ## 访问 访问 https://ip 或者 https://域名 ```