diff --git a/sisvietnamvn/.vscode/settings.json b/sisvietnamvn/.vscode/settings.json new file mode 100644 index 00000000..7b016a89 --- /dev/null +++ b/sisvietnamvn/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.compile.nullAnalysis.mode": "automatic" +} \ No newline at end of file diff --git a/sisvietnamvn/README.md b/sisvietnamvn/README.md index 70be7d0b..5088e7dd 100644 --- a/sisvietnamvn/README.md +++ b/sisvietnamvn/README.md @@ -185,3 +185,47 @@ To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`) - [Setting up Continuous Integration](https://www.jhipster.tech/documentation-archive/v9.1.0/setting-up-ci/) - [Node.js](https://nodejs.org/) - [NPM](https://www.npmjs.com/) + +#Structure + +Using NGINX (via aaPanel) with Tomcat is a very common and recommended setup. In this architecture, NGINX acts as a Reverse Proxy. It handles incoming internet traffic (ports 80 and 443 for SSL) and forwards the requests to your Tomcat application running in the background (usually on port 8080). + +Here is the step-by-step guide to setting this up in aaPanel: + +Step 1: Start your Tomcat/Spring Boot App +Make sure your application is running. By default, your project seems to run on port 8080. + +If using embedded Tomcat: Run your .jar file in the background (e.g., nohup java -jar your-app.jar --spring.profiles.active=prod &). +If using standalone Tomcat: Ensure Tomcat is started and the app is deployed. +Step 2: Configure the Website in aaPanel +Log in to your aaPanel dashboard. +Go to the Website menu on the left sidebar. +Click Add site (if you haven't already). +Enter your domain name (e.g., sisvietnam.vn). +For PHP version, select Static (since Java handles the backend, you don't need PHP). +Click Submit to create the site. +Step 3: Set up the Reverse Proxy +In the Website list, click on the Settings button for your newly created domain. +In the settings window, click on the Reverse proxy tab on the left. +Click Add reverse proxy and fill in the details: +Proxy name: Give it any name (e.g., TomcatProxy). +Target URL: Enter http://127.0.0.1:8080 (Change 8080 if your app is running on a different port). +Sent Domain: Leave it as $host (the default). +Click Submit. +Step 4: Configure Spring Boot to Trust the Proxy (Crucial) +Because NGINX sits in front of your app, Tomcat will think all requests are coming from 127.0.0.1 instead of the user's real IP, and it might get confused about http vs https (which breaks redirects and security). + +To fix this, you need to tell your Spring Boot app to read the headers forwarded by NGINX. Open your src/main/resources/config/application-prod.yml (or application.yml) and add: + +yaml +server: + forward-headers-strategy: framework +(Note: JHipster usually configures this automatically for the prod profile, but it is good to double-check). + +Summary of How it Works Now: +A user visits https://your-domain.com. +NGINX (aaPanel) receives the request on port 443. +NGINX forwards the request to http://127.0.0.1:8080. +Tomcat (Java) processes the request and sends the HTML/JSON back to NGINX. +NGINX sends the response back to the user. +You can also use aaPanel's built-in SSL manager to easily apply Let's Encrypt certificates to your NGINX site, and your Tomcat backend won't need to worry about SSL certificates at all! \ No newline at end of file diff --git a/sisvietnamvn/src/main/resources/static/images/YTDown_YouTube_Benh-vien-Da-Khoa-Quoc-Te-SIS-Can-Tho-Th_Media_pcz597Ou5U_001_1080p (online-video-cutter.com).mp4 b/sisvietnamvn/src/main/resources/static/images/YTDown_YouTube_Benh-vien-Da-Khoa-Quoc-Te-SIS-Can-Tho-Th_Media_pcz597Ou5U_001_1080p (online-video-cutter.com).mp4 new file mode 100644 index 00000000..d18fd894 Binary files /dev/null and b/sisvietnamvn/src/main/resources/static/images/YTDown_YouTube_Benh-vien-Da-Khoa-Quoc-Te-SIS-Can-Tho-Th_Media_pcz597Ou5U_001_1080p (online-video-cutter.com).mp4 differ diff --git a/sisvietnamvn/src/main/resources/templates/fragments/footer.html b/sisvietnamvn/src/main/resources/templates/fragments/footer.html index 7f3a84d5..f03348c7 100644 --- a/sisvietnamvn/src/main/resources/templates/fragments/footer.html +++ b/sisvietnamvn/src/main/resources/templates/fragments/footer.html @@ -37,8 +37,8 @@