Home >Backend Development >PHP Tutorial >The nginx reverse proxy fails and the page can be captured, but the css inside the page cannot be obtained because it uses a relative path. What should I do?

The nginx reverse proxy fails and the page can be captured, but the css inside the page cannot be obtained because it uses a relative path. What should I do?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-27 09:06:522148browse

The environment is windows, and the current configuration is like this:

<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>

The captured page is displayed like this

Reply content:

The environment is windows, and the current configuration is like this:

<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>

The captured page is displayed like this

<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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn