Hello @vmarko
I’m having the same issue, so instead of creating new thread, I thought it’s best to comment on this thread.
The error in nginx syntax indicates an unknown directive “Header” that has been included in the main nginx.conf configuration file.
The unknown directive has been added to the W3TC nginx include file, also called nginx.conf.
nginx: [emerg] unknown directive "Header" in /var/www/example.com/public_html/nginx.conf
If you look at the image that @youssefx added above, it’s easy to identify the issues. The issue is not caused by “some security aspect” but rather W3TC.
After you enable the Feature Policy / Permissions Policy, W3TC adds Header set and not add_header for this header: this is what W3TC adds to the W3TC nginx.conf file – the issue is clearly visible.
add_header Referrer-Policy "strict-origin-when-cross-origin";
Header set Feature-Policy "accelerometer 'none'"
Header set Permissions-Policy "accelerometer=(none)"
add_header Vary "Accept-Encoding"
Header set is an Apache web server directive
add_header is a nginx web server directive.
W3TC is adding Apache directives to an nginx configuration file, which results in a nginx synax test failing.
You need to add only add_header Permissions-Policy “followed by the created policy”;
EXAMPLE:
add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=self,payment=()";
Feature policy needs to be removed entirely.
I hope your dev’s can attend to this issue asap, as it’s means you are not able to implement a Permissions Policy on cached files.
Regards