我目前正在实施内容安全策略。但我的 apache 拒绝接受配置设置。
我目前使用的apache2版本是:2.2.22和2.4.7。这些 apache2 版本似乎都不起作用。
我的配置设置是:
Header always set Content-Security-Policy: frame-src 'self' *.google.de google.de *.google.com google.com;
Header always set Content-Security-Policy-Report-Only: default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self'; report-uri https://www.myhostname.com/report/report.php;
Header always set X-Content-Security-Policy: frame-src 'self' google.de google.com;
Run Code Online (Sandbox Code Playgroud)
我在其中任一设置上收到以下错误消息。如果我注释掉一行,错误就会更改为以下行:
Output of config test was:
AH00526: Syntax error on line 7 of /etc/apache2/conf-enabled/security.conf:
Header has too many arguments
Action 'configtest' failed.
Run Code Online (Sandbox Code Playgroud)
我尝试了所有可能的设置组合,但出现了相同的错误消息。所以我开始相信,我的 apache 不支持这些标头?但我在网上没有找到任何关于这个问题的信息。
或者我只是错过了一些重要的东西?我还从其他页面复制了各种示例,它们产生了相同的错误。
标头总体工作正常。我还设置了几个其他标题,它们工作得很好:
Header always set X-Content-Type-Options nosniff
Header always set X-XSS-Protection "1; mode=block"
Header …Run Code Online (Sandbox Code Playgroud) 我有一个最近迁移到新服务器的网站。旧服务器在 nginx 配置中有一个 proxy_pass,以确保由于旧 DNS 导致的任何请求都被路由到新服务器。
几天过去了,我仍然看到一些流量在访问日志中访问旧服务器。
是否可以将特定标头添加到旧服务器提供的响应中,以指示应刷新该主机的 IP?也许缓存控制:无缓存或过期?或者可能是指示新 IP 的标头?
我在本地网络的不同服务器上运行几个网站。所有网站都通过一台添加了 HTTPS 并监控流量的服务器进行代理。
目前,如果有人做:
curl -I subdomain.domain.tld
Run Code Online (Sandbox Code Playgroud)
结果是:
curl -I https://subdomain.domain.tld
HTTP/1.1 200 OK
Date: Fri, 13 Jan 2017 09:19:02 GMT
Server: Jetty(8.y.z-SNAPSHOT)
Content-Type: text/html
Content-Length: 2379
Last-Modified: Tue, 10 Jan 2017 11:15:29 GMT
Run Code Online (Sandbox Code Playgroud)
如何使用 ReverseProxy 的另一个响应“覆盖”代理背后的服务器提供的响应?
例如,我希望我的输出看起来像这样(如果可能)
curl -I https://dubdomain.domain.tld
HTTP/1.1 200 OK
Date: Fri, 13 Jan 2017 09:19:02 GMT
Server: Apache24 (or even something else)
Content-Type: text/html
Content-Length: 2379
Last-Modified: Tue, 10 Jan 2017 11:15:29 GMT
Run Code Online (Sandbox Code Playgroud)
这是可以实现的吗?
我正在尝试向定向到特定端口的响应添加一些安全标头。我有以下配置的前端:
frontend desenv_ext_1
bind *:80
bind *:443 ssl crt /etc/ssl/certs/cert.pem
mode http
option tcplog
default_backend desenv_1
timeout client 5m
#ACL to new attempt
acl header_c dst_port 80
#Attempt with no ACL
http-response set-header X-Frame-Options SAMEORIGIN
#Attempt with ssl ACL
http-response set-header Strict-Transport-Security max-age=31535400;\ includeSubDomains;\ preload; if {ssl_fc}
http-response add-header Referrer-Policy no-referrer if !{ ssl_fc }
#Attempt with header_c ACL
http-response set-header X-Content-Type-Options nosniff if header_c
http-response add-header X-XSS-Protection 1;\ mode=block if header_c
#Attempt with rspadd
rspadd X-Backen-Serve\ laranja if header_c …Run Code Online (Sandbox Code Playgroud) 我们有一个带有 mod_cache 和 mod_deflate 以及其他模块的 Apache 2.2。问题是,如果我们在 Apache 文档中附加 Vary 标头...
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
Run Code Online (Sandbox Code Playgroud)
...我们最终在缓存中为每个用户代理变体提供了服务资源的副本。这会浪费磁盘空间并降低命中率。
那么,这个问题的首选解决方案是什么?放弃 Vary 标头并仅压缩“安全”资源,例如纯 html?
我已将我们公司的内网网站部署到 IIS 7 服务器,并添加了以下绑定信息。
IP地址:全部未分配端口:3333域名:subdomain_name.domain_name.com
尽管站点部署在端口 3333 上,但我希望能够在没有端口的情况下访问站点。
我也在 dns 中添加了条目。我可以 ping 完全限定的域名 (subdomain.domain.com),但是当我在浏览器中添加该 url 时,我得到 404。
当站点部署在端口 80 下时,它工作得很好。但是,当我的站点托管在默认端口 (80) 以外的任何其他设备上时,它不起作用。
有没有办法做到这一点?
我在 IIS7 服务器上有一个图片库。我想要一个按钮来强制下载当前可见的图像。
也许像设置一个 url 参数:http : //website.com/images/img.jpg?download
全局检测此参数,然后将 Content-Disposition 头设置为附件。
我的问题是,我该怎么做?我可以在 web.config 文件中以某种方式设置它吗?
我更像是一个前端的人。
当我访问:http : //web-sniffer.net/并检查我网站的标题 ( https://www.example.org ) 时,我收到状态代码 200
但是当我使用单选按钮 HTTP/1.0(没有 Host 标头)时,我得到一个状态代码 400(错误请求)。
我的 apache 日志显示“通过 SNI 提供的主机名 www.example.org,但 HTTP 请求中没有提供主机名”
我读了它以使其工作我需要关闭我的apache conf文件中的指令“SSLStrictSNIVHostCheck”。
我添加了这个指令,但是在创建 HTTP/1.0(没有主机头)时仍然得到状态代码 400
作为参考,这是我的 ports.conf 文件:
ServerName www.example.org
NameVirtualHost *:80
Listen 10.0.0.1:80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows …Run Code Online (Sandbox Code Playgroud) 标题说明了一切:从哪个版本开始,LimitRequestFieldSize 不再硬编码为最大值。8k?
似乎 2.2.15 仍然受到影响。
过去,您可以使用Microsoft 的 UrlScan来修改标题并删除显示的 IIS 版本。
这不适用于 IIS 7.5,并且 IIS 7.0 是支持的最新版本。有什么办法可以删除一些响应头吗?
运行安装了 IIS7.5 的 Windows Server 2008。
http-headers ×10
apache-2.2 ×4
apache-2.4 ×2
iis ×2
curl ×1
haproxy ×1
host ×1
httpd ×1
limits ×1
mod-cache ×1
mod-deflate ×1
nginx ×1
port ×1
redirect ×1
sni ×1
ubuntu ×1
url ×1