Ankündigung

Einklappen
Keine Ankündigung bisher.

LBS19000809: NGINX reverse proxy Einträge - wie anzulegen?

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    LBS19000809: NGINX reverse proxy Einträge - wie anzulegen?

    Hallo zusammen,

    ich bin gerade dabei die Anpassungen am Reverse Proxy vorzunehmen. Meiner läuft via nginx und nicht via apache.
    Laut Anleitung sollte das (zumindest für apache) so aussehen:

    # 1. Reverse-Proxy
    # https://<EDOMI-DNS-Name>/alexa muss aus dem Internet erreichbar sein (gültiges SSL Zertifikat ist notwendig, z.B. letsencrypt)
    # Diese URL muss intern auf /usr/local/edomi/www/admin/include/php/alexa-actions auf dem EDOMI Server verlinkt sein.
    # Zusätzlich muss https://<EDOMI-DNS-Name>/auth auf /usr/local/edomi/www/admin/include/php/alexa-actions/oauth2 verlinkt sein.
    # Dies erreicht man über einen Reverse-Proxy (apache oder nginx) => Detaillierte Anleitungen sind im EDOMI Forum zu finden (z.B. in der Doku zum LBS 19001201)
    #
    # Wenn man schon einen funktionsfähigen Rreverse Proxy vor EDOMI hat, dann reichen vermutlich folgende Ergänzungen im RevProxy Konfigurationsfile
    # (gilt nur für apache; bei nginx sieht das anders aber ähnlich aus):
    #
    # ProxyPass /auth http://edomi-test.feld.home/admin/in...actions/oauth2
    # ProxyPassReverse /auth http://edomi-test.feld.home/admin/in...actions/oauth2
    # ProxyPass /alexa http://edomi-test.feld.home/admin/in.../alexa-actions
    # ProxyPassReverse /alexa http://edomi-test.feld.home/admin/include/php/alexa-actions​
    Mein proxy-file unter /etc/nginx/sites-enabled/default sieht folgendermaßen aus:

    server {
    listen 443 ssl default_server;
    ssl_certificate /etc/letsencrypt/live/sslj.ddns.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/sslj.ddns.net/privkey.pem;
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name sslj.ddns.net;
    location /edomi/ {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass https://192.168.2.163/admin/lbs/alexa/;
    proxy_buffering off;
    proxy_connect_timeout 5; # more than http_server
    proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout proxy_http_version 1.1;
    proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
    }
    if ($scheme != "https") {
    return 301 https://$host$request_uri;
    }
    }​
    Kann mir einer sagen, wie ich die Datei passend ergänzen muss?
    Vielen Dank schon mal!
    Zuletzt geändert von sleuchs; 18.12.2023, 00:09.

    #2
    So nach ein bisschen rumprobieren und logischem Denken hier die Lösung. Einfach die Location für die beiden neuen Pfade kopieren und anpassen:

    server {
    listen 443 ssl default_server;
    ssl_certificate /etc/letsencrypt/live/sslj.ddns.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/sslj.ddns.net/privkey.pem;
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name sslj.ddns.net;
    location /edomi/ {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass https://192.168.2.163/admin/lbs/alexa/;
    proxy_buffering off;
    proxy_connect_timeout 5; # more than http_server
    proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout proxy_http_version 1.1;
    proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
    }
    location /auth/ {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass https://192.168.2.163/admin/include/...tions/oauth2/;
    proxy_buffering off;
    proxy_connect_timeout 5; # more than http_server
    proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout proxy_http_version 1.1;
    proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
    }
    location /alexa/ {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass http://192.168.2.163/admin/include/php/alexa-actions/;
    proxy_buffering off;
    proxy_connect_timeout 5; # more than http_server
    proxy_read_timeout 350; # 60 default, 300s is GNUnet's idle timeout proxy_http_version 1.1;
    proxy_next_upstream error timeout invalid_header http_500 http_503 http_502 http_504;
    }


    if ($scheme != "https") {
    return 301 https://$host$request_uri;
    }
    }

    Kommentar

    Lädt...
    X