Score:0

Nginx websocket reverse proxy remove location

cz flag

Trying to set up an nginx https reverse proxy to home assistant, this works:

...
location / {
        proxy_pass http://127.0.0.1:8123;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
}

But I would like to access it from a non-root url like home.local/ha. Similar to the goals of this question's asker. I have tried all of the answers on that thread, but none seem to allow the websockets to connect (I think). An example of something I tried:

...
location = /ha {
        return 302 /ha/;
}

location /ha/ {
        proxy_pass http://127.0.0.1:8123/;
        #proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
}

Any Ideas how I can get this to work?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.