DejàVu
DejàVu2mo ago

thread about urls

And still the same
15 Replies
lee
lee2mo ago
let's start a thread
lee
lee2mo ago
it looks like https://vinang.vn/ is hosting something else, not the convex backend. can you describe what nginx routing you have set up
Vi Nang - Admin Dashboard
Vi Nang admin dashboard - Manage your products, orders, and customers with our intuitive admin interface.
DejàVu
DejàVuOP2mo ago
DejàVu
DejàVuOP2mo ago
vinang.vn is hosting a frontend react also
lee
lee2mo ago
hmm. well the dashboard expects to be able to talk to all routes on the backend, not just /api/1.19.3/sync and /api/storage . Can you redirect all of /api/* to the 3210 port? (in that nginx file)
DejàVu
DejàVuOP2mo ago
Ok server { listen 443 ssl; server_name vinang.vn www.vinang.vn; root /var/www/vinang; index index.html; # SSL Configuration ssl_certificate /etc/letsencrypt/live/vinang.vn/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/vinang.vn/privkey.pem; location /api/ { proxy_pass http://localhost:3210; # The URL of your WebSocket server proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $http_host; proxy_cache_bypass $http_upgrade; 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 /dashboard { # Remove the /dashboard prefix when proxying to the backend rewrite ^/dashboard(/.*)$ $1 break; rewrite ^/dashboard$ / break; proxy_pass http://vinang.vn:6791; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; 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 /assets { alias /var/www/vinang/assets; try_files $uri $uri/ =404; } location / { try_files $uri $uri/ /index.html; } } server { listen 80; server_name vinang.vn www.vinang.vn; # Redirect HTTP to HTTPS return 301 https://$host$request_uri; } Like this? dashboard is able to connect to backend now But my picture still showing this GET https://vinang.vn:3210/api/storage/bbb0cccf-1622-4943-bb28-3af0834f8344 net::ERR_SSL_PROTOCOL_ERROR
lee
lee2mo ago
did you generate a new url with ctx.storage.getUrl after fixing the CONVEX_CLOUD_ORIGIN? also note /api isn't all of the apis either. the convex backend really expects to handle all url paths
lee
lee2mo ago
i would do something like location /convex/ which strips the /convex prefix and forwards to localhost:3210. then set your CONVEX_CLOUD_ORIGIN and NEXT_PUBLIC_DEPLOYMENT_URL to https://vinang.vn/convex
Vi Nang - Admin Dashboard
Vi Nang admin dashboard - Manage your products, orders, and customers with our intuitive admin interface.
DejàVu
DejàVuOP2mo ago
Ah it's worked Ok let me try that Thank you
lee
lee2mo ago
then something similar for the CONVEX_SITE_URL
DejàVu
DejàVuOP2mo ago
Ah one more thing Do you know why when I remove this part location /dashboard { # Remove the /dashboard prefix when proxying to the backend rewrite ^/dashboard(/.*)$ $1 break; rewrite ^/dashboard$ / break; proxy_pass http://vinang.vn:6791; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; 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; } It's not worked also
DejàVu
DejàVuOP2mo ago
I tried that CONVEX_CLOUD_ORIGIN and NEXT_PUBLIC_DEPLOYMENT_URL to https://vinang.vn/convex also but dashboard keep showing error like before
Vi Nang - Admin Dashboard
Vi Nang admin dashboard - Manage your products, orders, and customers with our intuitive admin interface.
DejàVu
DejàVuOP2mo ago
No description
lee
lee2mo ago
Could you share the new nginx config and docker-compose? I don't know if the dashboard supports running under a sub-path. I think it expects to have the entire path to play with. Could you set it up as a subdomain like https://dashboard.vinang.vn/ ?
DejàVu
DejàVuOP2mo ago
I set a subdomain for it and it's worked Thank you so much

Did you find this page helpful?