在使用workerman 或 webman等框架開發(fā)應用的時候需要配合nginx 或 apache進行轉發(fā),官網(wǎng)的文檔只有寫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
#轉發(fā)
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
#轉發(fā)
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>