Apache配置vue服务

在/etc/httpd/conf.d下新建 vi httpd-vhosts.conf
然后贴入如下
DocumentRoot “Vue根目录所在位置”

Options FollowSymLinks
AllowOverride None
Require all granted

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
RewriteEngine On
ProxyPreserveHost On
ProxyPass /api/websocket/ ws://127.0.0.1:端口/websocket/
ProxyPass /api http://127.0.0.1:端口 keepalive=On timeout=60
ProxyPassReverse /api http://127.0.0.1:端口

你可能感兴趣的:(微信小程序,技术文,python,centos,macos)