Weird problem with nginx matching home page
淡淡烟草味
淡淡烟草味 2017-05-16 17:28:20
0
4
408
upstream backend {
    server 192.168.0.100:80;
    server 192.168.0.100:81;
}
server {
    listen 80;
    server_name www.abc.com abc.com;
    root  /opt/wwwroot/abc.com/;

    location / {
        proxy_pass https://backend;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_hide_header X-Powered-By;
    }

    location = / { 
        index index.html index.htm index.php;
    }
}

I want the user not to use proxy_pass when visiting www.abc.com/. Instead, they can directly access the local /opt/wwwroot/abc.com/index.html page, and all other requests will go through proxy_pass
I've been working on it for a long time and I can't figure it out. It's a little weird. Please help me. .

淡淡烟草味
淡淡烟草味

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!