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.
640
questions
11
votes
1
answer
7k
views
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 ...
1
vote
2
answers
5k
views
Nginx not working with domain/url that points to server IP
The configuration I have set (below) works for localhost but not for my domain. The goal is to access port 3000 externally with basic auth so only I can access it. When I go to localhost, it is ...
0
votes
0
answers
24
views
Allow both `'Access-Control-Allow-Origin' '*'` and `Content-Security-Policy "frame-ancestors *"`
I have the following conf.d/prod.conf.
It does not raise Refused to display 'https://v10.frontend.tech/' in a frame because it set 'X-Frame-Options' to 'sameorigin'. because of add_header Content-...
0
votes
1
answer
107
views
Apache 2.4 Read from request header and set the same in response header
I am using Apache 2.4.6
I wanted to check if a custom header X-CUSTOM-HEADER is present in the request, if yes then set the same header and same value to the response. If the header is not present in ...
0
votes
1
answer
4k
views
Nginx - Reverse proxy - add request header to each request
I have nginx as a reverse proxy. I am trying to add a request header for each request, so i tried:
location / {
proxy_pass some.host.com;
proxy_set_header MY_HEADER somename;
}
But the header is ...
0
votes
0
answers
13
views
Config nginx proxy for tomcat app on Ubuntu [duplicate]
I have that config for nginx:
server {
listen 80;
server_name myDomain;
access_log /var/log/nginx/tomcat-access.log;
error_log /var/log/nginx/tomcat-error.log;
underscores_in_headers on;
if ($...
0
votes
0
answers
10
views
When does HTTP server send response header Connection: <number> or TE?
I am confusing with a proprietary CWMP ACS sending me these values in the header. What's main purposes of that?
-1
votes
1
answer
86
views
Nginx error "upstream prematurely closed FastCGI request while reading upstream" with generated file download
I just spent the whole day trying to figure out this error.
We have a PHP script that generates a file for download. After upgrading nginx (1.16 -> 1.24), this script suddenly started randomly ...
0
votes
0
answers
74
views
Change server header on all endpoints (Flask + Nginx + Gunicorn)
I'm working on a Flask app that uses gunicorn and nginx and should hide its server header, so I managed to do it only for the homepage, like this:
gunicorn.conf.py
import gunicorn
gunicorn.SERVER = '.'...
0
votes
0
answers
118
views
PHP post data lost with Transfer-Encoding: chunked; Apache regression?
I am moving a PHP application from an older CentOS 7 server with Apache 2.4.6 and PHP 7.3.33 (mod_php) to a newer Alma Linux 9 server with Apache 2.4.57 and PHP 8.0.30 (PHP-FPM). This is a back-end ...
1
vote
1
answer
4k
views
Set content-type header for jsonp in htaccess
I'm having trouble with a 3rd-party javascript game that is installed on my site, where the content-type response header being returned is application/json rather than application/javascript for a ...
-1
votes
1
answer
49
views
What are cons of websockets? [closed]
I mean why at first place polling and server events exist if websocket can not only solve the problems they are solving but also allow additional functionalities (like bidirectional nature). I guess ...
1
vote
1
answer
684
views
NGINX 302 redirect / proxy
I have an icecast server that runs on port 8000 however when I set up a proxy using NGINX I seem not to be able to make it look like it is the original server.
I am wondering is there anyway to kinda ...
0
votes
1
answer
87
views
How do I add a header to a single static file in IIS 10?
Server is Windows Server 2016
I need to serve a single static file with a different header than all the other files (Cache-Control: max-age=15)
A different answer gives the leaf XML node as: <...
2
votes
1
answer
5k
views
Which static file types does Nginx generate ETags for by default?
In modern versions of Nginx, the ETag is automatically generated for static file types, even if you don't specifically enable the etag on in your location blocks or otherwise:
https://nginx.org/en/...
0
votes
0
answers
30
views
ADFS does not send X-Frame-Options header
ADFS Server does not send the X-Frame-Options header, although it is configured on the server.
(Get-AdfsResponseHeaders).ResponseHeaders
Key Value
--- -----...
2
votes
1
answer
2k
views
Disable nginx version in Server header on AWS Elastic Beanstalk
I want to disable the default nginx behaviour where it adds a Server header including the nginx version: nginx/1.18.0. I'm fine if it just says nginx.
From what I can find, I can do that by adding set ...
2
votes
1
answer
18k
views
Why are "Request header read timeout" messages in error log when page loads are short?
I am running a Rails application with Apache 2.4.10 and mod_passenger. The site uses https exclusively. I am seeing these messages in my error log:
[Wed May 31 19:05:37.528070 2017] [reqtimeout:info] ...
0
votes
0
answers
30
views
Placement of HTTP Headers in VirtualHost Containers?
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Content-Type-...
0
votes
0
answers
390
views
Why does nginx as a reverse proxy not send Referrer-Policy header?
A bit of context : I'm using nginx as a reverse-proxy for a bunch of apps running in Docker containers.
Among those apps there is Nextcloud (fpm), and the settings page complains about HTTP Referrer-...
0
votes
0
answers
89
views
Is there a Apache module can fully log HTTP requests, in a non processed way?
I'm looking for an Apache module that is able to log the RAW content of HTTP requests, unprocessed. Here is one example :
POST https://foobar/ HTTP/1.1
Host: foorbar
Connection: keep-alive
Content-...
0
votes
1
answer
45
views
Nginx add_header Link not parsed by Lighthouse
I'm trying to investigate why Google isn't indexing some pages (allegedly, because they redirect) and, when using Lighthouse to check an example page, I see the following:
Error parsing link header (...
2
votes
0
answers
379
views
Why is CloudFront failing to pass a header from the origin to the client?
I have CloudFront configured with an API Gateway origin. In the application accessed via API Gateway, my application responds to a particular request with a Content-Disposition header so that the data ...
0
votes
0
answers
68
views
Setting a HTTP Header in ProxyPass to have dynamic route
I am setting up a request header using :
RequestHeader set X_FIELD "expr=%{tolower:%{req:SOME-VAL}}"
and want to send the value of this HTTP Header in ProxyPass.
now I want to send the same ...
0
votes
0
answers
153
views
Do ETags generated on upstream need If-None-Match check? (NGINX)
(Reposting my post deleted after a year of inactivity)
Let's assume I use etag off (and if_modified_since off with add_header Last-Modified "" to not make redundancy) in NGINX and I generate ...
0
votes
1
answer
95
views
iptables string matching feasability; possible use with fail2ban
We have several Apache 2.4 web servers behind a load balancer and CDN front end - where HTTPS is terminated - we see the client IP in headers from the front end in the back end Apache logs. I'm ...
11
votes
5
answers
19k
views
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 ...
0
votes
2
answers
157
views
Apache/httpd 'Header set Server' is ignored/overridden
I am using this in a VirtualHost
<IfModule headers_module>
Header set ProcessingTime "%D"
Header set Server "Apache 2.4"
</IfModule>
I can see that the ...
2
votes
1
answer
974
views
Apache GZIP for images - any reason?
JPEG, GIF, PNG and WEBP images are already compressed. Is there any reason to serve them up using GZIP compression, regardless of whether or not the client says it may accept GZIP compression?
curl -H ...
8
votes
3
answers
24k
views
Apache Custom Header with an environment variable
I try to set a custom HTTP Header with an environment variable** with Apache server 2.4.6 and headers_module.
I work inside a HTTP VHost on port 80.
Everything work as expected with basic example ...
2
votes
1
answer
1k
views
Adding custom headers on error responses from haproxy
I have the following haproxy config that adds the access-control-allow-origin header on successful 200 requests with the below config. My problem is, when I hit timeouts or haproxy itself (not my ...
1
vote
1
answer
4k
views
Nginx - Even after adding the directive 'access control allow origin' the request logs error
I am trying to run nginx infront of my nodejs application (I am using windows machine)
My NodeJS Application is running in 3000 port
I have started the Nginx at 8070 port
When i try to hit http://...
0
votes
1
answer
4k
views
Logging response headers in Apache reverse proxy without sending them to the client
We use serveral Apache servers as reverse proxy in front of numerous backend servers. The backend servers send a HTTP response header ("Cast") which contains an internal name of the backend server.
...
0
votes
0
answers
34
views
Serving webpage in different language based on HTTP headers, using Apache negotiation module - shows dir listing only
I would like to configure Apache, such that when we send a request with a given language header, the server should send us back the right version. For example, I have index.eng.html and index.de.html. ...
2
votes
3
answers
10k
views
How to keep Authentication header with redirect using NGINX ingress annotations
I have an nginx ingress controller for my kubernetes cluster. I have a need to add a permanent redirect to an ingress which I can successfully do with
nginx.ingress.kubernetes.io/permanent-redirect: "...
0
votes
0
answers
14
views
How can I add the (virtual) ServerName value as customer Header in Apache2?
I would like to get the ServerName on the HTTP response of Apache in a custom header.
Something like this:
Header Set X-VirtualServerName "%{SERVERNAME}"
Please consider this string can be ...
0
votes
0
answers
200
views
Browser not sending username with request in HTTP headers
I'm facing an issue where the browser is not sending the username with the request headers in my web application. I've tried using Google chrome and Edge for testing purposes.
I have observed this ...
0
votes
1
answer
915
views
CORS access-control headers not visible in the response headers section of Chrome inspector
Using https://cors-test.codehappy.dev/ to test our test server's new CORS policy, we receive:
These are the response headers received when making the request:
access-control-allow-credentials: true
...
5
votes
1
answer
4k
views
http headers vanish when proxying http errors through nginx
I'm using nginx as TLS terminator in front of an Apache 2.4 server.
I'm using add_header X-Content-Type-Options nosniff; in nginx to add this header to every response.
If the HTTP status code returned ...
0
votes
1
answer
209
views
Caddyfile header directive unable to override file_server ETag
Invoking caddy run against the Caddyfile:
http://localhost
header ETag forcedValue
file_server
I expect curl -v http://localhost/Caddyfile to show a response with the ETag forcedValue.
Instead, a ...
4
votes
3
answers
11k
views
HTTP/1.1 Status Codes 400 and 417, cannot choose which
I've got a processing file which handles the user sent data, before that, however, it compares the input from client to the expected values to ensure no client-side data change.
I can say I don't ...
0
votes
0
answers
111
views
Apache Server Config Set Headers Conditionally
I am trying to set cache age for 200 responses and no cache for rest of the calls.
I tried below config, which works fine when 200 OK response comes up and I can see max-age=800 in headers
But for ...
1
vote
2
answers
2k
views
Apache 2.4.16 Response Header value clipped
Problem: The value of a Response Header is greater than 8K and always clipped.
Server Config:
Apache 2.4.16-x64 with mod_proxy and mod_proxy_http / Running on Windows Server 2012
Httpd.conf:
...
0
votes
2
answers
990
views
Which HTTP header maps to Apache's %u log format token?
We have an httpd.conf that contains the following log format and uses the %u token for logging the remote user:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
...
4
votes
3
answers
7k
views
Clear browser local cache by sending http headers?
I have modified js and css files in my website. But browser still fetch the contents from local cache because browser has stored it. I want to fetch the fresh content from the server without clearing ...
0
votes
0
answers
933
views
Content-Security-Policy frame-ancestors not working
I'm running an OpenLiteSpeed server and would like to only allow webpages that start with a specific url on my site (e.g. https://example.com/video/**) to be iframed by others. (I want to allow anyone ...
3
votes
3
answers
28k
views
How do I configure UTF-8 Content-Type header in Apache?
My website has pages and other content with UTF-8 encoding. For HTML, setting the encoding in a meta tag is no problem. However, I also have raw text files with UTF-8 encoding that aren't displayed ...
3
votes
3
answers
9k
views
How to filter Varnish logs based on XID?
I'm running into infrequent 503 errors which appear hard to pinpoint. Varnishlog is driving me mad, since I can't seem to get the information I want out of it.
I'd like to see both the client- and ...
1
vote
1
answer
2k
views
Nginx - No last-modified or Etag response header on HTML
I am facing a rather odd issue with my web server. The server is configured with Ubuntu 20.04, Nginx v1.22.1, PHP 8.0, and MariaDB to host my WordPress website.
The issue is, the server is not sending ...
0
votes
1
answer
767
views
Writing a RewriteRule based on X-Forwarded-Host
I have an Apache webserver behind a load balancer which proxies request to Apache and have problem regarding configuring directories.
Here is my scenario:
Upper Load Balancer proxies request to ...