phpstudy 使用webman多应用nginx绑定本地域名
官方文档:https://www.workerman.net/doc/webman/others/nginx-proxy.html
nginx配置文件:
upstream webmanApi { server 127.0.0.1:8787; keepalive 10240; } server { server_name api.web.com; listen 80; access_log off; root "F:/WWW/Webman/public"; location ^~ / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Connection ""; if (!-f $request_filename){
#默认应用可以去掉这行 rewrite ^/(.*)$ /api/$1 break; proxy_pass http://webmanApi; } } }