我知道大多数人都是向后执行的(apache到nginx),但是托管此项目的服务器有其他具有特定配置的项目,所以.最好还是坚持我们的现状
我想要容纳的是将一个nginx虚拟主机配置从docs 示例迁移到apache2.4,用于离心机golang消息服务器。
这就是我所拥有的
#### This part it's commented because the server says it has incorrect syntax
# <Proxy "balancer://centrifugocluster"> {
# Enumerate all upstream servers here, in case you want to clusterize
# BalancerMember http://127.0.0.1:8000 # default host and port, change it if need it
# BalancerMember http://127.0.0.1:8001;
# </Proxy>
# ProxyPass / balancer://centrifugocluster/
<VirtualHost *:80>
ServerName centrifugo.MY_HOSTING.com
Redirect permanent ^(.*) https://centrifugo.MY_HOSTING.com/$1
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName centrifugo.MY_HOSTING.com
SSLEngine On
SSLCertificateFile /PATH/TO/CRT/FILE.crt
SSLCertificateKeyFile /PATH/TO/KEY/FILE.key
SSLCertificateChainFile /PATH/TO/CHAIN/FILE.crt
<Location "/connection/">
# Required for websockets
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule /connection/(.*) http://127.0.0.1:8000/connection/$1 [P,L]
</Location>
<Location "/">
ProxyPass http://127.0.0.1:8000/
ProxyPassReverse http://127.0.0.1:8000/
</Location>
ErrorLog ${APACHE_LOG_DIR}/PATH/SERVER_LOG/FILE.log
CustomLog ${APACHE_LOG_DIR}/PATH/ACCESS_LOG/FILE.log combined
#### This part I'm not sure how to translate it
ErrorDocument 500 "Server Error 500"
ErrorDocument 502 "Server Error 502"
ErrorDocument 503 "Server Error 503"
ErrorDocument 504 "Server Error 504"
</VirtualHost>
</IfModule>服务器有apache2.4和ubuntu18,离心机配置为
{
"secret": "SECRET",
"admin_password": "PASSWORD",
"admin_secret": "ADMIN-SECRET",
"api_key": "API-KEY",
"engine": "memory",
"admin": true,
"debug": true,
"log_level": "debug"
}当前行为
404 page not foundcentrifugo.MY-HOST.com确实显示了这个404错误websocat库(从服务器外部) websocat ws://centrifugo.MY-HOST.com/connection/websocket时,它说的是WebSocketError: Received unexpected status code. Error runningwebsocat库(从服务器内部,我的意思是通过ssh连接) websocat ws://localhost:8000/connection/websocket时,它挂起.(等待我相信的信息)running说,离心机服务器已经启动并监听端口8000,并与netstat和主管检查。127.0.0.1更改为localhost,将documentRoot添加到apache项目的路径中,什么都没有.我做错什么了?
发布于 2019-10-07 13:37:56
没关系,这是我在主管配置上的错误。我有这样的经历:
[program:centrifugo]
command=sudo /var/www/centrifugo-server/centrifugo
autostart=true
autorestart=true
stderr_logfile=/var/log/centrifugo.error.log
stdout_logfile=/var/log/centrifugo.output.log我将配置文件与它的完整路径放在一起,并移除sudo,它的工作原理就像一种魅力。
command=/var/www/centrifugo-server/centrifugo --config=/var/www/centrifugo/config.json
我把它留在这里以防这能帮到任何人
不管怎么说,如果有人知道如何在虚拟主机上转换平衡器配置,那部分仍然是缺失的,谢谢
https://stackoverflow.com/questions/58236565
复制相似问题