This is essentially a built-in Chrome browser itself and privacy concerned people can switch to another privacy concerned browser to avoid being tracked. But website owners can also opt-out of FLoC by making some simple modifications in their web server HTTP response header. I would suggest checking out this Google and GitHub page to learn more about FLoC. In this article, we’ll cover ways that you as a website owner can use to opt-out of FLoC by simple configuration change in web servers.

Custom HTTP Header

A custom HTTP response header ensures that the website owner is opting out of FLoC. The response header for this is: Let’s see the implementation.

NGINX

For NGINX, you need to add add_header directive within each server block (if a single configuration file is being used for multiple websites) or to each respective server configuration file. And then restart NGINX service: Alternatively, you can follow another approach by adding the below in the http block. It would look like below in HTTP response headers.

Apache

For Apache web server, add the custom header in your configuration file as: Then restart Apache to make it effective: Which will have an output like below.

WordPress

If your WordPress is shared hosting, you won’t have the option to edit the webserver configuration file. But good news is, you can set headers in its codebase via hooks. In your active theme’s function.php, add the following lines at the end: Save the file in the WordPress admin backend and the header should be pushed in all new requests. Make sure to clear cache in its mechanism/plugin to make the new header effective. Here is how my implementation output looks like. Another easy solution would be to use the HTTP Headers plugin.

HAProxy

HAProxy allows adding the header directive in its configuration. In frontend, listen or backend section of the configuration (whichever applicable), add the following directive: Make sure to restart your HAProxy server as: This will make the header effective for all new requests.

Traefik

Traefik, mostly used as an ingress controller for the containerized environment, can be configured to opt out of FLoC similar to the above servers. In your traefik.toml file, add the following lines: Or for YAML based configuration (traefik.yml) use: Or if using Traefik with Docker, modify the traefik label in docker-compose.yml as:

Summary

FLoC is a new surveillance mechanism and if you don’t want to show an interest-based advertisement on your website, you can opt-out by implementing Permissions Policy headers as explained above. As a user, you can check out this dedicated page (Am I FloCed?) to see if you’re being tracked with FLoC.

How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 2How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 24How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 40How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 56How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 29How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 20How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 57How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 18How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 27How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 56How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 87How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 97How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 75How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 57How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 53How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 70How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 79How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 65How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 50How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 4How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 95How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 89How to Block FLoC using Nginx  Apache  WordPress  HAProxy and more  - 33