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.
Alexey Ten's user avatar
  • 8,697
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 '%{...
Kevin Danikowski's user avatar
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. ...
BillThor's user avatar
  • 27.9k
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
nuster cache server's user avatar
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 ...
HBruijn's user avatar
  • 80.3k
4 votes

Nginx on CentOS: How can I change the "Server" header?

You probably want add_header Server "mystartup/1.0" always.
womble's user avatar
  • 97k
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 ...
Michael Hampton's user avatar
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 ...
Habovh's user avatar
  • 271
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; } ...
JimmidyJoo's user avatar
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 ...
jfried's user avatar
  • 451
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 ...
Giacomo M's user avatar
  • 131
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 ...
eKKiM's user avatar
  • 1,539
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....
AfajarS's user avatar
  • 21
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 ...
anx's user avatar
  • 9,738
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 ...
Tero Kilkanen's user avatar
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.
Krydos's user avatar
  • 11
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 ...
Alexey's user avatar
  • 59
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#...
Zhang Buzz's user avatar
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 ...
Ivan Shatsky's user avatar
  • 2,866
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-...
Aaron's user avatar
  • 11
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. ...
HBruijn's user avatar
  • 80.3k
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(.*) "...
miknik's user avatar
  • 326
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: ...
welcomeboredom's user avatar
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 ...
gxx's user avatar
  • 5,651
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 ...
Cedric Knight's user avatar
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 ...
Jason Martin's user avatar
  • 5,093
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 ...
jasonmclose's user avatar
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 ...
Mircea Vutcovici's user avatar
1 vote

Cant connect to S3 with nginx

Consider temporarily setting the proxy_pass backend service to either a local service or an HTTP echo service so you can review the full HTTP request being sent to Amazon. (If you use an HTTP echo web ...
Mark Stosberg's user avatar
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 ...
Andy Fowler's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible