Heim >Backend-Entwicklung >PHP-Tutorial >Der Nginx-Reverse-Proxy schlägt fehl und die Seite kann erfasst werden, aber das CSS in der Seite kann nicht abgerufen werden, da es einen relativen Pfad verwendet.
Die Umgebung ist Windows und die aktuelle Konfiguration ist wie folgt:
<code> location / { root html; index index.html index.htm; } location /baidu { proxy_pass http://localhost:97; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } </code>
Die erfasste Seite wird wie folgt angezeigt
Die Umgebung ist Windows und die aktuelle Konfiguration ist wie folgt:
<code> location / { root html; index index.html index.htm; } location /baidu { proxy_pass http://localhost:97; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } </code>
Die erfasste Seite wird wie folgt angezeigt
<code> root "网站路径"; location / { index index.html index.htm; } location /baidu { proxy_pass http://localhost:97; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }</code>