gpt4 book ai didi

Apache 代理通行证 : Page not refreshing automatically after SSL installed

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:28 27 4
gpt4 key购买 nike

昨天,我配置了一个 Apache 反向代理,以便在运行在端口 8080 上的 docker 中为 Ansible AWX 获取 SSL 证书。带有代理的 Apache 在监听端口 80 的 docker 前面。一切正常,但现在如果我开始工作,网站不会自行刷新。我必须手动完成才能获得结果。如果我通过浏览服务器 ip 来完成它,它工作正常。

这是我的 default.conf 的代码:

SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on
<VirtualHost *:443>
ServerName example.com
ServerAdmin mail@example.com

ProxyPass / http://IP:8080/
ProxyPassReverse / http://IP:8080/
ProxyPreserveHost On
ProxyPassReverseCookiePath / /

<Proxy *>
Order deny,allow
Allow from all
Allow from localhost
</Proxy>


SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>


<VirtualHost *:80>

ServerName example.com
ServerAdmin webmaster@localhost


Redirect permanent / https://example.com

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

ProxyPass / ws://IP:8080/

RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI}
[END,NE,R=permanent]
</VirtualHost>

非常感谢! :)

最佳答案

谢谢你的提示,Dusan。解决了。​​

这是一个 websocket 错误,我通过将这些代码行添加到我的 default.conf 来修复它。

    RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://localhost:8080%{REQUEST_URI} [P]

关于 Apache 代理通行证 : Page not refreshing automatically after SSL installed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55530410/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com