https://github.com/jshensh/phpReverseProxy
Repository files navigation
基于 https://github.com/jshensh/php-curl-class 的一个应用
请替换 Line 5 的域名以及 Line 7 的实际路径
请替换 Line 6 的源站访问协议、Line 7 的源站域名以及 Line 8 的当前站点域名,Line 154 起的输出内容替换数组视情况修改
转发用户的 GET 请求
转发用户的 POST 请求
转发用户的 PUT 请求
转发用户的 DELETE 请求
转发用户发送的所有 Header(除 Accept-Encoding 和 Host)
转发服务器返回的所有 Header(除 Content-Length 和 Content-Encoding)
替换服务器返回的内容
#!/bin/shoriginProtocol="http"originSite="baidu.com"thisSite="example.com"# 以上三行需要修改cd /home/wwwroot
git clone https://github.com/jshensh/phpReverseProxy ${thisSite}rm -rf ${thisSite}/.git/cd ${thisSite}sed -i "s/example.com/${thisSite}/g" ./nginx.conf
mv ./nginx.conf /usr/local/nginx/conf/vhost/${thisSite}.conf
sed -i "s/http/${originProtocol}/g" ./index.php
sed -i "s/example.com/${thisSite}/g" ./index.php
sed -i "s/baidu.com/${originSite}/g" ./index.php
composer install
chown -R www:www ./*lnmp nginx reload
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://zblog.hqyman.cn/post/10688.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~