Unifi Controller over NGINX Proxy, CORS issue?

Pagina: 1
Acties:

Vraag


Acties:
  • 0 Henk 'm!

  • NeFoRcE
  • Registratie: Mei 2004
  • Laatst online: 05-06 15:28

NeFoRcE

Hallo? Bent u daar?

Topicstarter
Dag!

Na veel gepiel is het eindelijk gelukt om m'n Unifi Controller te voorzien van HTTPS (self signed), en dit dan weer via NGINX te laten lopen. Op die manier hoop ik dan allerlei veiligheidszaken te kunnen omzeilen. Want;

Ik wil m'n Unifi Controller in een iframe laden (in Home Assistant).

Dit werkt. Ik zie namelijk de loginpagina van Unifi.

Maar zodra ik succesvol probeer in te loggen, wordt ik teruggeleid naar de loginpagina (Dit gebeurd niet als ik de pagina rechtstreeks aanroep).

Dit zie ik in 'Network' van Chrome Inspector;

Afbeeldingslocatie: https://tweakers.net/i/RlSxhwz2AYFCeVF3AIbLa8nCzJI=/800x/filters:strip_exif()/f/image/m16htkMuyIEVVt4BhNvdaq4F.png?f=fotoalbum_large

Waarna ik wordt doorgeleid naar de inlogpagina;

Afbeeldingslocatie: https://tweakers.net/i/9rReKiP-wqJ10NewAK9sbuor8tg=/800x/filters:strip_exif()/f/image/AaxKstErhQyrZocy0X4KhOfS.png?f=fotoalbum_large

En m'n NGINX config:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
server {

    #listen 80;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name nuc2.lan;

    ssl_certificate /root/openssl_cert_generation/nuc2.lan/certificate.pem;
    ssl_certificate_key /root/openssl_cert_generation/nuc2.lan/key.pem;
    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;

    location / {
        # Proxy Unifi Controller UI traffic
        # The lack of '/' at the end is significant.
        proxy_pass https://192.168.2.88:8443;
        proxy_ssl_verify off;
        proxy_ssl_session_reuse on;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        ## Specific to Unifi Controller
        proxy_hide_header Authorization;
        proxy_set_header Referer '';
        proxy_set_header Origin '';
    }

    location /inform {
        # Proxy Unifi Controller inform endpoint traffic
        # The lack of '/' at the end is significant.
        proxy_pass https://192.168.2.88:8080;
        proxy_ssl_verify off;
        proxy_ssl_session_reuse on;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        ## Specific to Unifi Controller
        proxy_hide_header Authorization;
        proxy_set_header Referer '';
        proxy_set_header Origin '';
    }

    location /wss {
        # Proxy Unifi Controller UI websocket traffic
        # The lack of '/' at the end is significant.
        proxy_pass https://192.168.2.88:8443;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        ## Specific to Unifi Controller
        proxy_set_header Origin '';
        proxy_buffering off;
        proxy_hide_header Authorization;
        proxy_set_header Referer '';
    }

}


bovenstaande code komt dan weer van;

https://community.ui.com/...1f-4469-9e39-26f680542357


Mis ik nog iets? Zie ik wat over het hoofd? Of is het technisch gewoon niet mogelijk? Man, ik ben zo dichtbij voor m'n gevoel...

Professioneel Heftruck Syndroom