Expose GET /loan-paid-off-letters/branches?province_id= for form pickers, require loans.user_id, and proxy the Vite frontend under /online/. Co-authored-by: Cursor <cursoragent@cursor.com>
104 lines
3.3 KiB
Plaintext
104 lines
3.3 KiB
Plaintext
# /etc/nginx/sites-available/test.webulgam.com.conf
|
|
# ln -s /etc/nginx/sites-available/test.webulgam.com.conf /etc/nginx/sites-enabled/
|
|
|
|
server {
|
|
listen 80;
|
|
server_name test.webulgam.com;
|
|
|
|
if ($host = test.webulgam.com) {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
return 404;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name test.webulgam.com;
|
|
|
|
root /var/www/tbbank.gov.tm/frontend/src;
|
|
index index.html;
|
|
|
|
charset utf-8;
|
|
client_max_body_size 100M;
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
add_header X-Content-Type-Options "nosniff";
|
|
|
|
ssl_certificate /etc/letsencrypt/live/test.webulgam.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/test.webulgam.com/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
# --- existing project → :5050 ---
|
|
location /admin {
|
|
proxy_pass http://127.0.0.1:5050;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location /public/ {
|
|
proxy_pass http://127.0.0.1:5050;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location /api {
|
|
proxy_pass http://127.0.0.1:5050;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# --- online frontend (Vite) → :5173 ---
|
|
# Example: https://test.webulgam.com/online/
|
|
# Do NOT strip /online — Vite base is /online/, stripping causes a 302 loop.
|
|
location = /online {
|
|
return 301 /online/;
|
|
}
|
|
|
|
location /online/ {
|
|
proxy_pass http://127.0.0.1:5173;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
# Vite HMR / WebSocket
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
# --- online-backend → :5005 ---
|
|
# Example: https://test.webulgam.com/online-backend/api/admin/...
|
|
location /online-backend/ {
|
|
rewrite ^/online-backend/(.*)$ /$1 break;
|
|
proxy_pass http://127.0.0.1:5005;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
# The prefix is stripped above, so tell the app what it was: Swagger
|
|
# needs it to build URLs the browser can actually reach.
|
|
proxy_set_header X-Forwarded-Prefix /online-backend;
|
|
}
|
|
|
|
location = /favicon.ico { access_log off; log_not_found off; }
|
|
location = /robots.txt { access_log off; log_not_found off; }
|
|
|
|
error_page 404 /index.php;
|
|
|
|
location ~ /\.(?!well-known).* {
|
|
deny all;
|
|
}
|
|
}
|