OSX - High Sierra Reverse Proxy schlägt fehl

360
El Dude

Beim Versuch, auf meinem Entwicklungscomputer einen Proxy-Dienst einzurichten, der example.com/phpauf die Entwicklung einer Hybrid-App auf Basis von Ionic verweist, um CORS-Probleme zu vermeiden.

Was ich getan habe:

sudo vi /etc/apache/httpd.conf 

aktivieren

LoadModule proxy_module libexec/apache2/mod_proxy.so LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so 

hinzufügen

Include /private/etc/apache2/vhosts/*.conf   sudo vi /private/etc/apache2/vhosts/proxy.conf  <VirtualHost localhost:9999> ProxyPass /php/ https://example.com/php </VirtualHost> 

Mein Proxy funktioniert nicht:

~ $ nc -v localhost 9999 nc: connectx to localhost port 9999 (tcp) failed: Connection refused nc: connectx to localhost port 9999 (tcp) failed: Connection refused nc: connectx to localhost port 9999 (tcp) failed: Connection refused 

Während Port 80 funktioniert:

~ $ nc -v localhost 80 found 0 associations found 1 connections: 1: flags=82<CONNECTED,PREFERRED> outif lo0 src ::1 port 50299 dst ::1 port 80 rank info not available TCP aux info available  Connection to localhost port 80 [tcp/http] succeeded!  HTTP/1.1 400 Bad Request Date: Wed, 25 Jul 2018 05:58:53 GMT Server: Apache/2.4.33 (Unix) Content-Length: 226 Connection: close Content-Type: text/html; charset=iso-8859-1  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> </p> </body></html> 

Die Firewall ist deaktiviert, daher keine Ahnung, wo sie versagt. Apache-Protokolle melden nichts im Zusammenhang mit Proxy.

0

0 Antworten auf die Frage