Questions tagged [http-headers]

HTTP header fields are components of the message header of requests and responses in the Hypertext Transfer Protocol (HTTP). They define the operating parameters of an HTTP transaction.

HTTP header fields are components of the message header of requests and responses in the Hypertext Transfer Protocol (HTTP). They define the operating parameters of an HTTP transaction.

Refer to RFC 2616

624 questions
11
votes
1 answer

How to add response headers with HAproxy 1.6 based on request URI?

I use HAproxy 1.6 as load balancer in front of tomcat servers. I need to add response headers based on the request URI. For e.g., I'd like to add the response header Cache-Control public,max-age="600" when the request uri is /api but not when the…
jmlrt
  • 113
  • 1
  • 1
  • 7
11
votes
3 answers

Can I use Public-Key-Pins with LetsEncrypt?

Can I setup Public-Key-Pins when I setup a cronjob to renew the LetsEncrypt certificate every 30 days? If the certificate is renewed then the Public-Key-Pin is also renewed right?
Bob Ortiz
  • 444
  • 4
  • 21
11
votes
5 answers

How do I add no-cache headers to all 404 pages served by apache and nginx?

I have recently run into an issue after switching to Cloudflare, and the solution is to basically stop Cloudflare from caching 404 responses. In our load-balanced multi-server setup, occasional 404s happen, but they're quickly fixed by rsync (via…
11
votes
2 answers

nginx proxy_pass rewrite of response header location

The aim of this nginx instance is to get GitLab and OpenWRT Luci to redirect through a reverse proxy. It's already working for several other websites, all which have a base url which seems to counter this issue. GitLab in this example is on the…
Jake Edwards
  • 267
  • 1
  • 2
  • 9
11
votes
1 answer

Sending Content (Message Body) along with 304 Not Modified header

For static html pages, when the response header from the server is 304 Not Modified, isn't it the server's responsibility to send back only the headers and not the message-body (html content) along with it ? Whats the point in sending 304 Not…
anjanesh
  • 337
  • 1
  • 3
  • 11
10
votes
1 answer

mod_headers not sending headers when file is PHP

I've got my .htaccess file set to the following: Header set MyHeader "I'm Set!" If I go to that directory (http://example.com/test/), which has no default index file, and view the network activity (in this case with Chrome), I can see that the…
Anthony
  • 315
  • 4
  • 15
10
votes
2 answers

Apache redirect and set cache headers?

Doing a redirect in Apache is easy (mod_alias): RedirectMatch ^.*$ http://portal.example.com/ Setting cache headers is equally easy: Header set Cache-Control max-age=0 Header set Expires "Thu, 01 Dec 1994 16:00:00 GMT" (I don't want this…
Jakob Borg
  • 1,453
  • 1
  • 10
  • 13
10
votes
3 answers

Amazon S3 not sending Content-Type header

I have an application that downloads content from various sources. It relies on the "Content-Type" header being set on images. The majority of web-servers do this correctly but it appears Amazon S3 server is not setting the Content-Type. I assume…
Luke____
9
votes
2 answers

How can I add in Apache Feature Policy Header?

I have a multimedia site which offers users to upload their own media (video,music) or embed media from sites like YouTube, Vimeo etc. Recently, new header is being announced. I tried to add this header but I believe I made a mistake somewhere. This…
Pelin Canikli
  • 229
  • 1
  • 2
  • 6
9
votes
2 answers

Apache Header Module Loaded but can't set headers in htaccess

I have Apache 2.2.29 (unix) setup and running on my new dev machine (mac). I am trying to set CORS headers for an API project - something that I have done many times. The htaccess file for the project looks like this:
Dan Lake
  • 91
  • 1
  • 1
  • 4
9
votes
1 answer

FastCGI cache "MISS" due to conflicting headers from PHP application?

I've setup FastCGI cache like this: location ~ \.php(/.*)?$ { fastcgi_cache RWI; fastcgi_cache_valid 200 60m; set $nocache 0; if ($request_method = POST) { set $nocache 1; } if ($http_cookie ~…
9
votes
4 answers

Cloudflare not caching static files as expected (cf-cache-status: MISS)

I'm wondering why Cloulflare would not cache a certain static js file. Given the reuqest: curl -I http://www.testlifeinuk.com/dist/lifeinuk.js the headers returned like: HTTP/1.1 200 OK Date: Mon, 12 Jan 2015 10:59:21 GMT Content-Type:…
Wudong
  • 201
  • 1
  • 2
  • 5
9
votes
1 answer

Haproxy: reject traffic by user agent from file

I am trying to reject connections from specific user agents (by matching a substring of the user-agent header) using an haproxy ACL with -f option to read from a file. However it is not working, it runs as if the configuration is being ignored. Can…
raugfer
  • 221
  • 1
  • 2
  • 5
9
votes
1 answer

Disabling 206 partial content responses on nginx

I have an HTML5 web app that uses a video tag. Depending on the user actions, different parts of the video will be played in response. This video does not exceed 5MB. I need this video to be entirely downloaded on the client otherwise the user will…
JuCachalot
  • 217
  • 1
  • 4
  • 6
9
votes
3 answers

Set Access-Control-Allow-Origin in nginx using wildcard domain

With nginx can I specify Access-Control-Allow-Origin using a wildcard like *.mydomain.com? Would it look like: add_header Access-Control-Allow-Origin *.mydomain.com; Thanks.
Justin
  • 5,328
  • 19
  • 64
  • 84
1 2
3
41 42