在使用workerman 或 webman等框架开发应用的时候需要配合nginx 或 apache进行转发,官网的文档只有写nginx,下面的apache的配置,前提是apche需要开启这两个模块:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot "/home/wwwroot/xxx/public"
ServerName b601402f.www.xxx.com
ServerAlias www.xxx.com xxx.com
#转发
ProxyPass / http://127.0.0.1:8791/
ProxyPassReverse / http://127.0.0.1:8791/
#errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/www.xxx.com-error_log"
CustomLog "/www/wwwlogs/www.xxx.com-access_log" combined
#DENY FILES
<Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
#PATH
<Directory "/home/wwwroot/xxx/public">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@example.com
DocumentRoot "/home/wwwroot/xxx/public"
ServerName SSL.www.xxx.com
ServerAlias www.xxx.com xxx.com
#转发
ProxyPass / http://127.0.0.1:8791/
ProxyPassReverse / http://127.0.0.1:8791/
#errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/www.xxx.com-error_log"
CustomLog "/www/wwwlogs/www.xxx.com-access_log" combined
#SSL
SSLEngine On
SSLCertificateFile /www/server/panel/vhost/cert/www.xxx.com/fullchain.pem
SSLCertificateKeyFile /www/server/panel/vhost/cert/www.xxx.com/privkey.pem
SSLCipherSuite EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5:ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLProtocol All -SSLv2 -SSLv3 -TLSv1
SSLHonorCipherOrder On
#DENY FILES
<Files ~ (\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
#PATH
<Directory "/home/wwwroot/xxx/public">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</Directory>
</VirtualHost>