You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blocked loading mixed active content “http://88.99.81.115:8080/api/v1" ... #106
Following the success of #105 (setup nginx to proxy the autobase console)
It's still not working because the console is just a UI which connects to the API on port 8080 ...
I think this just means we need to run the API server on the same domain ...
But to do that we need to create a proxy through nginx ...
I tried adding the config this morning:
2025/03/24 19:54:14 [emerg] 67966#67966: "server" directive is not allowed here in /etc/nginx/sites-enabled/autobase:1
nginx: configuration file /etc/nginx/sites-enabled/autobase test failed
Activity
nelsonic commentedon Mar 24, 2025
I think this just means we need to run the
APIserver on the same domain ...But to do that we need to create a proxy through
nginx...I tried adding the config this morning:
But it failed test:
But the syntax passes check: https://www.getpagespeed.com/check-nginx-config
Read a bunch of FAQ:
https://serverfault.com/questions/1077260/nginx-how-to-forward-8080
Still scratching my head ... 🙃
nelsonic commentedon Mar 25, 2025
Got
nginxto work with the following config:server { listen 8080; server_name autobase.dwy.is; location / { proxy_pass http://172.17.0.1:8082/; } }But still getting the same error:
Blocked loading mixed active content http://88.99.81.115:8080/api/v1
The problem is that the
consoleis being loaded overHTTPSwhereas theAPIis loaded overHTTP(no SSL/TLS!)Ref: https://stackoverflow.com/questions/18251128/why-am-i-suddenly-getting-a-blocked-loading-mixed-active-content
So the only way around this is for the
APIcontent to be requested/served overSSL... 😬nelsonic commentedon Mar 25, 2025
Updated
nginxconfig to:server { listen 80; server_name autobase.dwy.is; return 301 https://$host$request_uri; } server { server_name autobase.dwy.is; # stackoverflow.com/questions/14501047/add-response-header-nginx-proxy-pass # 1. hide the Access-Control-Allow-Origin from the server response proxy_hide_header Access-Control-Allow-Origin; # 2. add a new custom header that allows all * origins instead add_header Access-Control-Allow-Origin $http_origin; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, HEAD'; add_header X-Upstream $upstream_addr always; location / { proxy_pass http://172.17.0.1:82; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/dwy.is/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/dwy.is/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { listen 8080 ssl; ssl_certificate /etc/letsencrypt/live/dwy.is/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/dwy.is/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot server_name autobase.dwy.is; add_header Access-Control-Allow-Origin *; location / { proxy_pass https://172.17.0.1:8082/; } }Getting a bit long now ... 📜 🙃
New error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://autobase.dwy.is:8080/api/v1/projects?limit=999999999. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 502.
nelsonic commentedon Mar 25, 2025
Reading: https://www.reddit.com/r/nginx/comments/14cj9un/how_do_i_resolve_the_corspreflight_error_when/
nelsonic commentedon Mar 25, 2025
https://stackoverflow.com/questions/64889343/cross-origin-preflight-request-in-nginx-proxy
nelsonic commentedon Mar 25, 2025
http://88.99.81.115:8080/
Hmmm ... 💭
nelsonic commentedon Mar 25, 2025
Getting

502 Bad Gatewaynow: https://autobase.dwy.is:8080/Ah! I figured it out!! 🎉 The upstream is
HTTPand I was attempting asHTTPSderp!The line:
Needed to be:
The proxy on the local system is
httpso isn't a security issue; what matters is that it'shttpsover the net. 🔒Working now!
https://autobase.dwy.is/clusters

HTTPS🔐 🎉nelsonic commentedon Mar 25, 2025
I have a lot of tabs/windows to close ... 😜