22
votes
Accepted
proxy_set_header not working
You've got it wrong.
proxy_set_header directive sets headers that nginx sends to backend (127.0.0.1:8069 in your case).
What you need is add_header directive.
16
votes
Chrome DevTools - Request Header Size
Sort of...
go to the network tab and right click the first item and click copy as cURL (this is how you will get the header size.
Then go to terminal and do your curl command curl ... -w '%{...
8
votes
Accepted
Need help determining origin of spam email
Please don't obfuscate your server's identity. It make it impossible to check the DNS configuration to assist you.
You are incorrect in believing that all received are forged. However, they may be. ...
6
votes
Accepted
HAProxy - Add response header based on request host
You can use set-var
http-request set-var(txn.host) hdr(Host)
acl myhost var(txn.host) -m str example.com
http-response set-header X-Frame-Options SAMEORIGIN if myhost
4
votes
Accepted
Postfix swallows Bcc header
Postfix does nothing with the BCC field, as far as I know.
The BCC address, like the Cc is something that only exists in your email client. SMTP servers only know the RCPT TO: address in the ...
4
votes
Nginx on CentOS: How can I change the "Server" header?
You probably want add_header Server "mystartup/1.0" always.
3
votes
Is it possible to fix corrupt LUKS header?
LUKS2 has a backup header, but LUKS1 (which you are probably using, as LUKS2 is quite new and few distros support it yet) does not.
If you didn't backup the header yourself, you are screwed. Go to ...
2
votes
Accepted
Add proxy headers in named location using nested location regex
According to Richard from his comment on the original post, the original solution I came up with is not that bad.
However, since I like to avoid repeating myself, I've opted to include a file which ...
2
votes
Accepted
Keeping Headers During NGINX Rewrite
I was able to do what I wanted to achieve by getting rid of rewrite and replacing it with proxy_pass and resolver entries:
location /api/ {
if ($arg_server !~ "^(a|b)$") { return 404; }
...
2
votes
Redirect real IP client nginx
As far as i know you can't force nginx to put the real source ip in the ip header.
I recommend to refactor the application to read the X-Real-IP header you set in your configuration.
If the ...
2
votes
Accepted
set header in .htaccess not working if REQUEST_URI contains a word
I solved using THE_REQUEST instead of REQUEST_URI.
Thanks to this post https://stackoverflow.com/a/57379503/4641073 I read that REQUEST_URI can be changed from other directives, instead THE_REQUEST ...
2
votes
Block all requests except certain header
Blocking requests based on the existence of this specific header is a bad idea.
The reason is that anyone can spoof that header if they wanted. This could be filed under security by obscurity and it ...
2
votes
Linux header 4.9.0-11-amd64 is missing in debian
Debian 9 (stretch)?
from this thread's answer
edit (or create) /etc/apt/sources.list.d/snapshot.list
deb http://snapshot.debian.org/archive/debian/20190925T034604Z stretch main
deb http://snapshot....
1
vote
Accepted
Postfix header_checks with multi-line headers and capture group
If you know or can ensure there is only a certain number of variations, add additional expressions to catch those separately /..:(.*) (.*)$/ -> /..:$1$2/ - postfix will continue with the next ...
1
vote
How to add http host header in URL?
You need to add a subdomain doom.myteams.example.net to your DNS, which points to the IP address of your server.
After that, opening https://doom.myteams.example.net will get your request to the ...
1
vote
Accepted
Multipart text/html email from Invision Community not parsing correctly
I was able to fix this issue by editing Invision's code and changing one occurrence of PHP_EOL to "\r\n". Hopefully they include my changes in future releases of their software.
1
vote
Postfix header_check regex with if conditional not matching - change sender address when recipient domain matches
I have found my problem, and it stems from a fundamental misunderstanding of how this works. The header_check only works on ONE (1) line at a time. In the above case, even if the IF line did match, ...
1
vote
Removing one cookie in proxy_pass of nginx
I was able to make it work, but I am still not clear on why I need two exactly the same if's rewriting the value of the cookie.
So the root cause of the issue: I had too many requests, because the ...
1
vote
setup SameSite=none value in Nginx webserver
This can only add SameSite support. For change it, you have to install Nginx 1.19.3 and set as below:
proxy_cookie_flags one samesite=none;
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#...
1
vote
Accepted
Alter Nginx reverse proxy cache header from Public to Private
Directives from ngx_http_rewrite_module are processed before evaluation of $upstream_... variables. You should't treat nginx config as programming language where your operations executed sequentaly as ...
1
vote
Block all requests except certain header
I just found two solutions.
One is to use:
RewriteEngine On
RewriteCond %{HTTP:CF-IPCountry} ^$
RewriteRule ^ - [F,L]
The other is here:
https://community.cloudflare.com/t/stop-cloudflare-...
1
vote
I can see HTTP/2 headers with curl. But, if this protocol works with frames and binary numbers: shouldn't these headers be "invisible"?
curl is a fully fledged http/2 client (when you use the right switches) and when you would do a packet capture the individual network packets would only contain binary data and not ASCII headers.
...
1
vote
Accepted
add_header not working in Nginx location
You can actually just do this:
map $request_uri $robot_header {
default "";
~^/cars/sale(.*) "noindex, nofollow";
~^/bikes/sale(.*) "noindex, nofollow";
~^/motorbikes/sale(.*) "...
1
vote
Postfix swallows Bcc header
The answer above is misleading.
BCC doesn't exist just inside your mail client. Let's say I send email to [email protected] and I will put [email protected] into BCC. Two separate emails are generated:
...
1
vote
Set environment variables from header for Ruby/Rails app hosted in Nginx/Passenger
According to this bug report, this is currently broken:
passenger_env_var VAR $nginx_var; sets VAR to $nginx_var, not its value.
Possible workaround:
Drop passenger (but keep Nginx)
Setup redmine ...
1
vote
Accepted
Postfix MTA - Match string in header fields
www-data is the name of a web server user, frequently used for transactional email, for example Wikipedia notifications, so you should consider that you may be blocking legitimate mail as well as mail ...
1
vote
Pros/Cons to disabling HEAD requests with Nginx?
There's no real benefit to disallowing HEAD requests. Clients can use this to check if their cache is up to date. Disabling it will most likely cause them to retry with a GET. HEAD is used often ...
1
vote
Ignoring forwarder IP in syslog-ng
My work around for this isn't sexy, but it does work. I'm all ears if someone else knows of a better way.
Here is what I did. So in this situation, I'm trying to filter out IIS logs (s_net is ...
1
vote
Is https preventing a proxy from adding x-forward-for header?
When a browser is using a proxy will use CONNECT method to create a direct connection towards remote website.
This connection is using SSL/TLS protocol and the browser will communicate directly and ...
1
vote
Accepted
How to override "Content-Type" header with PHP script on Nginx
Are you sure that it's nginx, and not PHP which is adding the Content-type: text/html? It doesn't seem that way from your pasted config. It could be that you have other PHP code which is setting it ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
headers × 71nginx × 23
apache-2.4 × 8
http × 8
postfix × 7
php × 6
reverse-proxy × 6
http-headers × 6
email × 5
iis × 4
proxy × 4
https × 4
regex × 4
centos × 3
haproxy × 3
apache2 × 3
request × 3
linux × 2
networking × 2
azure × 2
smtp × 2
ip × 2
.htaccess × 2
configuration × 2
rewrite × 2