WLED icon indicating copy to clipboard operation
WLED copied to clipboard

Use relative paths for all links.

Open poelzi opened this issue 3 years ago • 5 comments

Carefully using relative links for everything and using wss in case the site was loaded over https. Now it is possible to use a nginx or apache to redirect to a wled node as a subdirectory.

I'm using home-assistant as a webapp which requires that all resources are loaded through https. I embed the wled through a iframe that is served by nginx and forwards the wled traffic. This requires currently to use a new hostname for each wled node. This patch allows also to use one host and map one path to one node.

This is the config my nixos generates and it works very well.

server {
        listen 0.0.0.0:443 ssl http2 ;
        listen [::]:443 ssl http2 ;
        server_name wled.example.com ;
        location /.well-known/acme-challenge {
                root /var/lib/acme/acme-challenge;
                auth_basic off;
        }
        root /var/www;
        ssl_certificate /var/lib/acme/wled.example.com/fullchain.pem;
        ssl_certificate_key /var/lib/acme/wled.example.com/key.pem;
        ssl_trusted_certificate /var/lib/acme/wled.example.com/chain.pem;
        location ^~ /devtest/ {
                proxy_pass http://wled-devtest.example.com/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
                include /nix/store/dwprz9w34r2yfi9m1b2c9vv3br8807jb-nginx-recommended-proxy-headers.conf;
        }
}

poelzi avatar May 18 '21 22:05 poelzi

Somebody needs to test this also, I tried to click everywhere and test all functionality, but it could easily be I missed something

poelzi avatar May 20 '21 17:05 poelzi

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. Thank you for using WLED!

stale[bot] avatar Sep 19 '21 02:09 stale[bot]

Could you verify and rebase this PR to use most recent master?

blazoncek avatar Oct 08 '21 11:10 blazoncek

I just saw this PR and I had already done my own implementation of this exact functionality, LOL. Pretty similar to what I did, but since you probably have a lot more experience with WLED than I do, I'll drop it and I'll see about getting this change and testing it further. So far, it looks pretty good.

Dr-Bix avatar Sep 15 '22 16:09 Dr-Bix

This PR needs to be brought up to speed with 0_14 branch to be of any use.

blazoncek avatar Sep 15 '22 16:09 blazoncek

A very late thank you for your PR and sorry for never getting around to it. Closing in favor of #2788 , as that is current to 0.14.

Aircoookie avatar Oct 21 '22 00:10 Aircoookie