PHP code example of ledc / webman
1. Go to this page and download the library: Download ledc/webman library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ledc / webman example snippets
conf
location ^~ / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
# 代理条件:文件不存在&目录内不存在index.html
set $should_proxy 1;
if (-f $request_filename) {
set $should_proxy 0;
}
set $index_file "${request_filename}/index.html";
if (-f $index_file) {
set $should_proxy 0;
}
# 是否执行代理
if ($should_proxy = 1) {
proxy_pass http://127.0.0.1:8787;
}
}