This commit is contained in:
Dmitry 2025-11-20 21:41:09 +03:00
parent 78ae1a557d
commit 73055ccf2e
5 changed files with 7 additions and 7 deletions

View file

@ -93,7 +93,7 @@ jobs:
run: | run: |
flutter pub get flutter pub get
flutter build web --release \ flutter build web --release \
--dart-define=API_BASE_URL=https://api.mnemo-cards.online:8444 \ --dart-define=API_BASE_URL=https://api.mnemo-cards.online \
--dart2js-optimization=O4 --dart2js-optimization=O4
- name: Deploy Web App - name: Deploy Web App

View file

@ -97,7 +97,7 @@ If you only made changes to the backend:
- **Permission Denied (SSH)**: Check your SSH keys. Ensure you can login to `root@147.45.152.129` without a password prompt (using keys). - **Permission Denied (SSH)**: Check your SSH keys. Ensure you can login to `root@147.45.152.129` without a password prompt (using keys).
- **Build Failed (Web)**: Run `flutter doctor` to ensure your local environment is correct. Try running `flutter build web --release` manually in `mnemo_cards_web_v2` to see detailed errors. - **Build Failed (Web)**: Run `flutter doctor` to ensure your local environment is correct. Try running `flutter build web --release` manually in `mnemo_cards_web_v2` to see detailed errors.
- **Backend Not Restarting**: SSH into the server and check logs: `journalctl -u mnemo_cards_server -f`. - **Backend Not Restarting**: SSH into the server and check logs: `journalctl -u mnemo_cards_server -f`.
- **Port Conflicts**: The web app is configured to talk to the API on port `8444` (HTTPS). Ensure the backend is actually running on this port. - **Port Conflicts**: The web app is configured to talk to the API on standard HTTPS port `443` via `https://api.mnemo-cards.online`. nginx handles SSL termination and proxies to backend on port `8081`.
## Configuration ## Configuration

View file

@ -68,7 +68,7 @@ jobs:
run: | run: |
cd mnemo_cards_web_v2 cd mnemo_cards_web_v2
flutter pub get flutter pub get
flutter build web --release --dart-define=API_BASE_URL=https://api.mnemo-cards.online:8444 --dart2js-optimization=O4 flutter build web --release --dart-define=API_BASE_URL=https://api.mnemo-cards.online --dart2js-optimization=O4
- name: Deploy Web App - name: Deploy Web App
run: | run: |

View file

@ -135,9 +135,9 @@ server {
add_header Referrer-Policy "no-referrer-when-downgrade" always; add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
# Proxy to HTTPS backend # Proxy to HTTP backend (SSL termination in nginx)
location / { location / {
proxy_pass https://localhost:8443; proxy_pass http://localhost:8081;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View file

@ -55,9 +55,9 @@ server {
add_header Referrer-Policy "no-referrer-when-downgrade" always; add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
# Proxy to HTTPS backend # Proxy to HTTP backend (SSL termination in nginx)
location / { location / {
proxy_pass https://localhost:8443; proxy_pass http://localhost:8081;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;