- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用反向代理(在 Apache 上)为 Magento 设置 Varnish 缓存以获取 https 缓存。我无法让它工作。到目前为止,我在设置反向代理时得到了 ERR_TOO_MANY_REDIRECTS 和 NET::ERR_CERT_AUTHORITY_INVALID(在尝试设置 Varnish 缓存以直接在 http/80 上响应时得到 503)。
技术栈如下:
web/seo/use_rewrites - 1
web/unsecure/base_url - https://www.{domain}.com/ //Previously it didn't work when I set this up with http. That's why it's https. Tested with http and no difference now.
web/unsecure/base_link_url - {{unsecure_base_url}}
web/unsecure/base_static_url -
web/unsecure/base_media_url -
web/secure/base_url - https://www.{domain}.com/
web/secure/use_in_frontend - 1 //tested 0, no difference
web/secure/use_in_adminhtml - 1 //tested 0, no difference
web/secure/base_link_url - {{secure_base_url}}
web/secure/base_static_url -
web/secure/base_media_url -
web/secure/offloader_header - SSL_OFFLOADED
web/url/use_store - 0
web/url/redirect_to_base - 1 //tested 0, infinite loading
web/default/front - cms
web/default/cms_home_page - home
web/default/no_route - cms/noroute/index
web/default/cms_no_route - no-route
web/default/cms_no_cookies - enable-cookies
web/default/show_cms_breadcrumbs - 1
web/cookie/cookie_lifetime - 3600
web/cookie/cookie_path -
web/cookie/cookie_domain -
web/cookie/cookie_httponly - 0
web/cookie/cookie_restriction - 0
web/session/use_remote_addr - 0
web/session/use_http_via - 0
web/session/use_http_x_forwarded_for - 0
web/session/use_http_user_agent - 0
web/session/use_frontend_sid - 1
web/browser_capabilities/cookies - 1
web/browser_capabilities/javascript - 1
web/browser_capabilities/local_storage - 0
web/default_layouts/default_product_layout -
web/default_layouts/default_category_layout -
web/default_layouts/default_cms_layout - 1column
ServerRoot "/etc/httpd"
Listen 8080
<IfModule unixd_module>
User apache
Group apache
</IfModule>
LoadModule php7_module /usr/lib/apache/libphp7.so
Include /etc/httpd/conf/extra/httpd-phpmodules.conf
DocumentRoot "/home/admin/domains/{domain}.com/public_html"
<IfModule dir_module>
Include /etc/httpd/conf/extra/httpd-directoryindex.conf
</IfModule>
<Files ".ht*">
Require all denied
</Files>
<Files ".user.ini">
Require all denied
</Files>
LogLevel warn
<IfModule log_config_module>
#replace %b with %O for more accurate logging
<IfModule mod_logio.c>
LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%a %l %u %t \"%r\" %>s %O" common
LogFormat "%O %I" bytes
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog /var/log/httpd/access_log common
</IfModule>
<IfModule alias_module>
# Include some DirectAdmin alias
Include conf/extra/httpd-alias.conf
</IfModule>
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-gzip .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler cgi-script .cgi
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddType video/x-ms-asf .avi
AddType video/mpeg .mpg
AddType video/mpeg .mpeg
AddType video/quicktime .mov
AddType video/x-ms-wmv .wmv
</IfModule>
incldes x20
Include conf/extra/directadmin-vhosts.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
!!!-----------------------------And here comes DirectAdmin httpd.conf:----------------------------!!!
[root@ ~]# cat /usr/local/directadmin/data/users/admin/httpd.conf
<Directory "/home/admin/public_html">
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
#RGroups apache access
RGroups @none
</IfModule>
<IfModule mod_fcgid.c>
SuexecUserGroup admin admin
</IfModule>
php_admin_flag engine ON
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@{domain}.com'
php_admin_value mail.log /home/admin/.php/php-mail.log
php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/opt/alt/php72/usr/share/pear/:/dev/urandom:/usr/local/lib/php/:/usr/local/php72/lib/php/
</Directory>
<VirtualHost {ip}:8080 >
ServerName www.{domain}.com
# ServerAlias www.{domain}.com {domain}.com //tested "on" - see errors
ServerAdmin webmaster@{domain}.com
DocumentRoot /home/admin/domains/{domain}.com/public_html
# UseCanonicalName OFF //tested uncommenting - see errors
<IfModule !mod_ruid2.c>
SuexecUserGroup admin admin
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
#RGroups apache access
RGroups @none
</IfModule>
CustomLog /var/log/httpd/domains/{domain}.com.bytes bytes
CustomLog /var/log/httpd/domains/{domain}.com.log combined
ErrorLog /var/log/httpd/domains/{domain}.com.error.log
<Directory /home/admin/domains/{domain}.com/public_html>
AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None
Options -ExecCGI -Includes +IncludesNOEXEC
php_admin_flag engine ON
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@{domain}.com'
php_admin_value mail.log /home/admin/.php/php-mail.log
php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/opt/alt/php72/usr/share/pear/:/dev/urandom:/usr/local/lib/php/:/usr/local/php72/lib/php/
</Directory>
</VirtualHost>
<VirtualHost {ip}:443 >
SSLEngine on
SSLCertificateFile /usr/local/directadmin/data/users/admin/domains/{domain}.com.cert.combined
SSLCertificateKeyFile /usr/local/directadmin/data/users/admin/domains/{domain}.com.key
SSLCACertificateFile /usr/local/directadmin/data/users/admin/domains/{domain}.com.cacert
ServerName www.{domain}.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/
RequestHeader set X-Forwarded-Port "443"
RequestHeader set X-Forwarded-Proto "https"
ServerAlias www.{domain}.com {domain}.com
# ServerAdmin webmaster@{domain}.com
DocumentRoot /home/admin/domains/{domain}.com/private_html
# UseCanonicalName OFF
# <IfModule !mod_ruid2.c>
# SuexecUserGroup admin admin
# </IfModule>
# <IfModule mod_ruid2.c>
# RMode config
# RUidGid admin admin
# #RGroups apache access
# RGroups @none
# </IfModule>
CustomLog /var/log/httpd/domains/{domain}.com.bytes bytes
CustomLog /var/log/httpd/domains/{domain}.com.log combined
ErrorLog /var/log/httpd/domains/{domain}.com.error.log
# <Directory /home/admin/domains/{domain}.com/private_html>
# AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None
# Options -ExecCGI -Includes +IncludesNOEXEC
# php_admin_flag engine ON
# php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@{domain}.com'
# php_admin_value mail.log /home/admin/.php/php-mail.log
# php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/opt/alt/php72/usr/share/pear/:/dev/urandom:/usr/local/lib/php/:/usr/local/php72/lib/php/
# </Directory>
</VirtualHost>
[root@ ~]# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 3037/named
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2203/exim
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 2208/dovecot
tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 19248/varnishd
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 2208/dovecot
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 2203/exim
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 2208/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 2208/dovecot
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
***tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 19248/varnishd
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 2203/exim
tcp 0 0 {ip}:53 0.0.0.0:* LISTEN 3037/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 3037/named
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2226/pure-ftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2201/sshd
tcp6 0 0 ::1:953 :::* LISTEN 3037/named
***tcp6 0 0 :::443 :::* LISTEN 19143/httpd
tcp6 0 0 :::3306 :::* LISTEN 2860/mysqld
tcp6 0 0 :::2222 :::* LISTEN 19694/directadmin
tcp6 0 0 :::111 :::* LISTEN 1/systemd
***tcp6 0 0 :::80 :::* LISTEN 19248/varnishd
***tcp6 0 0 :::8080 :::* LISTEN 19143/httpd
tcp6 0 0 :::53 :::* LISTEN 3037/named
tcp6 0 0 :::21 :::* LISTEN 2226/pure-ftpd
tcp6 0 0 :::22 :::* LISTEN 2201/sshd
udp 0 0 {ip}:53 0.0.0.0:* 3037/named
udp 0 0 127.0.0.1:53 0.0.0.0:* 3037/named
udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd
udp 0 0 127.0.0.1:323 0.0.0.0:* 1341/chronyd
udp 0 0 0.0.0.0:659 0.0.0.0:* 1356/rpcbind
udp6 0 0 :::53 :::* 3037/named
udp6 0 0 :::111 :::* 1/systemd
udp6 0 0 ::1:323 :::* 1341/chronyd
udp6 0 0 :::659 :::* 1356/rpcbind
最佳答案
我注意到你确实设置了 RequestHeader set X-Forwarded-Proto "https"
在端口 443 vhost 中的 Apache 配置中。
这应该向您的后端宣布,尽管连接是在纯 HTTP 中完成的,但它最初是作为 HTTPS 连接终止的。
目前您的 Magento 配置使用 SSL_OFFLOADED
作为卸载 header ,但是您的 Apache 配置使用 X-Forwarded-Proto
.
您可以尝试如下更新您的 Magento 配置吗?web/secure/offloader_header - X-FORWARDED-PROTO
这应该有助于 Magento 寻找正确的 header 并意识到它不需要重定向回 HTTPS,因为该页面已经终止为 HTTPS。
关于apache - Magento + Varnish/ReverseProxy + Apache + DirectAdmin 导致 NET::ERR_CERT_AUTHORITY_INVALID 或 ERR_TOO_MANY_REDIRECTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60006979/
我创建了自己的根 CA 并用它签署了 SSL 证书,然后将根 CA 导入 Windows 受信任的根 CA 列表,并将 SSL 证书导入我的 Web 应用程序服务器。当尝试访问相应的网页时,我得到 E
如何使用获取 API 从提供 NET::ERR_CERT_AUTHORITY_INVALID 的站点获取数据。我用了这个但是得到了 net::ERR_INSECURE_RESPONSE下面是我的代码
我有一个带有 websockets 的 Laravel 应用程序。我已经为 websocket 和 pusher 配置设置了所有需求。但是每当我测试我的广播 channel 时 app.js:5828
我正在开发的 Web 应用程序需要从本地网络中的多个不同 IOT 获取数据,例如, const response = await fetch("https://192.168.0.245/api/au
我正在尝试在基于专用服务器 (WHM) 上添加 CloudFlare 免费 ssl。我在 Chrome 中收到警告“ERR_CERT_AUTHORITY_INVALID”。 cloudflare ss
我正在通过 https 实现 Node js 脚本。 Node js const options = { key: fs.readFileSync('private.key'), cert:
我有以下 default-ssl.conf 配置: SSLProtocol all -SSLv2 -SSLv3 SSLHonorCipherOrder On SSLCipher
突然之间,我似乎对使用本地主机的 Google Chrome 有问题。 我正在尝试访问我的任何开发站点(使用 Ampps),但出现以下错误:- Your connection is not priva
我有一个 React 应用程序,我正在尝试从后端进行 Axios GET 调用。它返回以下错误 "ERR_CERT_AUTHORITY_INVALID" 在 Postman 中,当我从 Postman
我正在尝试使用 vue-axios 通过 https 进行发布请求。 但是,由于我使用的是我创建的自签名证书,因此出现以下错误: net::ERR_CERT_AUTHORITY_INVALID 经过搜
我在我的 64 位 Windows 7 机器上的虚拟服务器上工作,几周后这个错误开始出现在 google chrome 上: XAMPP: your connection is not private
我正在尝试在我的 (wamp) apache 服务器上安装一个 letsencrypt ssl 证书。在 Windows Server 2012 x64 计算机上运行。 这些是我执行的确切步骤: 第一
我正在尝试遵循本指南 https://angular.io/guide/setup-local .我安装了 node.js 和 angular cli 并构建了默认应用程序: ng new my-ap
我已经为我的开发域“购买”了 3 年 StartSSL 免费 1 类 DV 证书,并按照他们的说明将其安装在 NGINX 上。 我注意到他们提供的 nginx 证书包含 DV 证书,其中添加了我的 1
我在客户端使用 socket io: const socket = require('socket.io-client')('https://localhost:4200', {secure: tru
当我尝试从 android 移动设备访问我的 ruby 网站时出现以下错误,任何人都可以帮助我解决这个问题。 添加了以下错误 NET::ERR_CERT_AUTHORITY_INVALID 最佳答
我有一个位于 http://localhost:4200 的 AngularJS 和一个位于 https://localhost 的 Apache 服务器 api。这两个单独工作都很好。 但是,当尝试
我正在为研究所的一个项目创建防病毒软件。作为项目的一部分,我正在尝试创建一个可以拦截 https 数据的代理服务器。 为此,我创建了一个 CA 证书并将其附加到 Firefox 和 Windows 存
具有自签名证书的 Tomcat 应用程序在 Chrome 浏览器中导致 ERR_CERT_AUTHORITY_INVALID 我已经设置了一个 https 并创建了一个自签名证书。但是,当我连接到 U
我正在通过安全数据通信为我的后端和 UI 实现 SSL。我的后端在 Springboot 中,UI 是有角度的。我已经为我的后端生成了 jks,我的后端 API 现在是 https。 但是,一旦我将应
我是一名优秀的程序员,十分优秀!