千家信息网

nginx反向代理conf的配置

发表于:2025-02-07 作者:千家信息网编辑
千家信息网最后更新 2025年02月07日,1、nginx 反向代理location /index_test.php {proxy_set_header X-Real-IP $remote_addr;proxy_set_header Host
千家信息网最后更新 2025年02月07日nginx反向代理conf的配置

1、nginx 反向代理
location /index_test.php {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://x.x.x.x;
}

2、nginx动态代理php location ~ \.php$ {                            set $php_server "127.0.0.1:9000";            if ($request_uri ~ "^/aliexpress/"){                set $php_server  "127.0.0.1:9000";            }                            if ($request_uri ~ "^/amazon/"){                set $php_server  "127.0.0.2:9000";            }

0