veranschaulichen: Stamm und Alias im Standort
Die URI des Proxy-Passes am Standort Wenn die Proxy-Pass-URL keine URI enthält
Wenn die Proxy-Pass-URL eine URI hat, wird die passende URI abgeschnitten Beispiele Root im Standort root@pts/1 $ ls -ld /data/web/lctest*|awk '{print $NF}' /data/web/lctest /data/web/lctest2 /data/web/lctest3 /data/web/lctest4 Standort /lctest { Stammverzeichnis /Daten/Web/; } Standort /lctest2/ { Stammverzeichnis /Daten/Web/; } Standort /lctest3 { Stammverzeichnis /Daten/Web; } Standort /lctest4/ { Stammverzeichnis /Daten/Web; } Die Ergebnisse des Curl-Tests lauten wie folgt Hinweis: Wenn Sie bei der Eingabe im Browser am Ende kein / hinzufügen, wird es automatisch hinzugefügt, curl jedoch nicht root@pts/1 $ curl http://tapi.xxxx.com/lctest/ Hallo Welt root@pts/1 $ curl http://tapi.xxxx.com/lctest2/ Hallo Welt 2 root@pts/1 $ curl http://tapi.xxxx.com/lctest3/ 3 Hallo Welt root@pts/1 $ curl http://tapi.xxxx.com/lctest4/ Hallo Welt 4 Standortalias Standort /lctest5 { Alias /Daten/Web/; } Standort /lctest6/ { Alias /Daten/Web/; } Standort /lctest7 { Alias /Daten/Web; } ## 403 /data/web verboten Standort /lctest8/ { Alias /Daten/Web; } Die Ergebnisse des Curl-Tests lauten wie folgt curl 'http://tapi.kaishustory.com/lctest5/' curl 'http://tapi.kaishustory.com/lctest6/' curl 'http://tapi.kaishustory.com/lctest7/' Die Ergebnisse sind alle /data/web/index.html Ausgabe root@pts/1 $ curl 'http://tapi.kaishustory.com/lctest8/' <html> <head><title>403 Verboten</title></head> <body bgcolor="weiß"> <center><h1>403 Verboten</h1></center> <hr><center>nginx</center> </body> </html> Standort-Proxy-Passwort #--------proxy_pass-Konfiguration--------------------- Standort /t1/ { Proxy-Passwort http://Servers; } #Normal, nicht gekürzt Standort /t2/ { Proxy-Passwort http://Servers/; } #Normal, Kürzung Standort /t3 { Proxy-Passwort http://Servers; } #Normal, nicht gekürzt Standort /t4 { Proxy-Passwort http://Servers/; } #Normal, Kürzung Standort /t5/ { Proxy-Passwort http://Servers/Test/; } #Normal, Kürzung Standort /t6/ { Proxy-Passwort http://Servers/Test; } #Fehlt „/“, Kürzung Standort /t7 { Proxy-Passwort http://Servers/Test/; } #Enthält „//“, Kürzung Standort /t8 { Proxy-Passwort http://Servers/Test; } #Normal, Kürzung Testskripte für i in $(seq 8) Tun url=http://tapi.xxxx.com/t$i/doc/index.html echo "----------$url-----------" Curl-URL Erledigt Testergebnisse ----------http://tapi.xxxx.com/t1/doc/index.html------------ /t1/doc/index.html ----------http://tapi.xxxx.com/t2/doc/index.html------------ /doc/index.html ----------http://tapi.xxxx.com/t3/doc/index.html------------ /t3/doc/index.html ----------http://tapi.xxxx.com/t4/doc/index.html------------ /doc/index.html ----------http://tapi.xxxx.com/t5/doc/index.html------------ /test/doc/index.html ----------http://tapi.xxxx.com/t6/doc/index.html------------ /testdoc/index.html ----------http://tapi.xxxx.com/t7/doc/index.html------------ /test//doc/index.html ----------http://tapi.xxxx.com/t8/doc/index.html------------ /test/doc/index.html Das Obige ist der vollständige Inhalt dieses Artikels. Ich hoffe, er wird für jedermanns Studium hilfreich sein. Ich hoffe auch, dass jeder 123WORDPRESS.COM unterstützen wird. Das könnte Sie auch interessieren:
|
<<: Tutorial zur Installation und Konfiguration von MySQL Workbench unter CentOS
>>: Beispiel-Tutorial zur JavaScript-Typerkennungsmethode
Wenn nginx eine Anfrage empfängt, gleicht es zunä...
Ich habe vor kurzem ein Dateisystem erstellt und ...
React Native ist ein plattformübergreifendes Fram...
Inhaltsverzeichnis Vorwort Design erreichen Zusam...
Vorne geschrieben Nachdem wir Nginx basierend auf...
Da die von nativen JS initiierten Netzwerkanforde...
1: Unterschiede bei Geschwindigkeit und Lademethod...
Docker installiert MySQL Docker-Suche MySQL. Such...
JS berechnet den Gesamtpreis der Waren im Warenko...
Voraussetzung: Celery wird in Django eingeführt. ...
Docker-Installation Installieren von Abhängigkeit...
Offizielle Website von Prometheus (auch Prometheu...
1, %, steht für beliebige 0 oder mehr Zeichen. Es...
Code kopieren Der Code lautet wie folgt: <fram...
In diesem Artikelbeispiel wird der spezifische Co...