[GH-ISSUE #582] How to use 'Custom Nginx Configuration' function to modify headers for added security #489

Open
opened 2026-02-26 06:33:04 +03:00 by kerem · 33 comments
Owner

Originally created by @infi8ite on GitHub (Aug 26, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/582

Checklist

What is troubling you?

In short, I am having some trouble using the Custom Nginx Configuration.

I just want to start by saying this is a great tool for noobs like me who are just getting into self-hosting and reverse proxy management. As a beginner, I am slightly paranoid about the security of my server and is chasing this elusive A+ header test (see https://securityheaders.com/) for the domain that I am hosting (I am currently getting an E grade with the default NPM with 'Block common exploits' enabled).

After some googling, I learnt that it will be useful to include the following NGINX configurations for added security

	add_header X-Xss-Protection "1; mode=block" always;
	add_header X-Content-Type-Options "nosniff" always;
	add_header Strict-Transport-Security "max-age=2592000; includeSubdomains" always;
	add_header X-Frame-Options "SAMEORIGIN" always;
	proxy_hide_header X-Powered-By;
	add_header 'Referrer-Policy' 'no-referrer';
	add_header Content-Security-Policy "frame-ancestors mydomain.com files.mydomain.com;";

The issue is when I dump them to Custom Nginx Configuration section of the GUI, nothing happens. If I try to add {} to the script, NPM will go offline.

	{add_header X-Xss-Protection "1; mode=block" always;
	add_header X-Content-Type-Options "nosniff" always;
	add_header Strict-Transport-Security "max-age=2592000; includeSubdomains" always;
	add_header X-Frame-Options "SAMEORIGIN" always;
	proxy_hide_header X-Powered-By;
	add_header 'Referrer-Policy' 'no-referrer';
	add_header Content-Security-Policy "frame-ancestors mydomain.com files.mydomain.com;";}

Can someone shed some light into how I could go about adding these headers?

Much appreciated.

Ed

Originally created by @infi8ite on GitHub (Aug 26, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/582 **Checklist** - Please read the [setup instructions](https://nginxproxymanager.com/setup/) Done - Please read the [FAQ](https://nginxproxymanager.com/faq/) Done **What is troubling you?** In short, I am having some trouble using the Custom Nginx Configuration. I just want to start by saying this is a great tool for noobs like me who are just getting into self-hosting and reverse proxy management. As a beginner, I am slightly paranoid about the security of my server and is chasing this elusive A+ header test (see https://securityheaders.com/) for the domain that I am hosting (I am currently getting an E grade with the default NPM with 'Block common exploits' enabled). After some googling, I learnt that it will be useful to include the following NGINX configurations for added security add_header X-Xss-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header Strict-Transport-Security "max-age=2592000; includeSubdomains" always; add_header X-Frame-Options "SAMEORIGIN" always; proxy_hide_header X-Powered-By; add_header 'Referrer-Policy' 'no-referrer'; add_header Content-Security-Policy "frame-ancestors mydomain.com files.mydomain.com;"; The issue is when I dump them to Custom Nginx Configuration section of the GUI, nothing happens. If I try to add {} to the script, NPM will go offline. {add_header X-Xss-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header Strict-Transport-Security "max-age=2592000; includeSubdomains" always; add_header X-Frame-Options "SAMEORIGIN" always; proxy_hide_header X-Powered-By; add_header 'Referrer-Policy' 'no-referrer'; add_header Content-Security-Policy "frame-ancestors mydomain.com files.mydomain.com;";} Can someone shed some light into how I could go about adding these headers? Much appreciated. Ed
Author
Owner

@gregfr commented on GitHub (Aug 27, 2020):

That's a very good question. Your first attempt should be working (no brackets), but it's not.
I'm currently investigating this; I noticed for example that NPM adds a header "X-Served-By $host;" but it's not there either, so I suspect some aspect of nginx I don't know.

<!-- gh-comment-id:681926835 --> @gregfr commented on GitHub (Aug 27, 2020): That's a very good question. Your first attempt should be working (no brackets), but it's not. I'm currently investigating this; I noticed for example that NPM adds a header "X-Served-By $host;" but it's not there either, so I suspect some aspect of nginx I don't know.
Author
Owner

@dash74 commented on GitHub (Aug 27, 2020):

I just tried using this from an old site of mine and it's working. It shows up on https://securityheaders.com/ as functioning.

add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy same-origin;
add_header Content-Security-Policy "default-src 'self' https://.elementor.com https://.google.com; font-src 'self' data: https://.googleapis.com https://.gstatic.com; img-src 'self' data: https://i.imgur.com https://.gravatar.com https://.elementor.com; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' data: https://.googleapis.com; script-src-elem 'self' 'unsafe-inline' https://.cloudflare.com; frame-src 'self' https://.youtube.com https://.google.com;";

<!-- gh-comment-id:682078833 --> @dash74 commented on GitHub (Aug 27, 2020): I just tried using this from an old site of mine and it's working. It shows up on https://securityheaders.com/ as functioning. add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; add_header Referrer-Policy same-origin; add_header Content-Security-Policy "default-src 'self' https://*.elementor.com https://*.google.com; font-src 'self' data: https://*.googleapis.com https://*.gstatic.com; img-src 'self' data: https://i.imgur.com https://*.gravatar.com https://*.elementor.com; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' data: https://*.googleapis.com; script-src-elem 'self' 'unsafe-inline' https://*.cloudflare.com; frame-src 'self' https://*.youtube.com https://*.google.com;";
Author
Owner

@dash74 commented on GitHub (Aug 27, 2020):

I tried your code as well and it's working. The only way that I could get it too work though is pictured below. If I tried too list the domain name it would not register.

image

<!-- gh-comment-id:682102327 --> @dash74 commented on GitHub (Aug 27, 2020): I tried your code as well and it's working. The only way that I could get it too work though is pictured below. If I tried too list the domain name it would not register. ![image](https://user-images.githubusercontent.com/28696570/91477889-04ede400-e86d-11ea-9f44-6b030550aec9.png)
Author
Owner

@gregfr commented on GitHub (Sep 23, 2020):

After some digging, I think it's because of an oddity in the way nginx handles headers configuration: https://www.peterbe.com/plog/be-very-careful-with-your-add_header-in-nginx

<!-- gh-comment-id:697329589 --> @gregfr commented on GitHub (Sep 23, 2020): After some digging, I think it's because of an oddity in the way nginx handles headers configuration: https://www.peterbe.com/plog/be-very-careful-with-your-add_header-in-nginx
Author
Owner

@jmarque3 commented on GitHub (Nov 4, 2020):

Was this ever sorted out? I'm struggling to get the exact headers added to mine. I've even tried adding it to custom/server_proxy.conf with no luck.
From my troubleshooting, I think something is overwriting it.

<!-- gh-comment-id:721519206 --> @jmarque3 commented on GitHub (Nov 4, 2020): Was this ever sorted out? I'm struggling to get the exact headers added to mine. I've even tried adding it to custom/server_proxy.conf with no luck. From my troubleshooting, I think something is overwriting it.
Author
Owner

@lordraiden commented on GitHub (Jan 6, 2021):

Any news about this? It's a quite important feature that should work

<!-- gh-comment-id:755274212 --> @lordraiden commented on GitHub (Jan 6, 2021): Any news about this? It's a quite important feature that should work
Author
Owner

@mattjmeier commented on GitHub (Mar 30, 2021):

I'm also curious if anyone has found a solution... I'm having the same problem. At one point I came across this thread and I got it working using the custom location as demonstrated above.

But today it stopped working (ie the headers are no longer working... I'm using it with CloudFlare if that's relevant) when I had to renew the certs.

<!-- gh-comment-id:809844959 --> @mattjmeier commented on GitHub (Mar 30, 2021): I'm also curious if anyone has found a solution... I'm having the same problem. At one point I came across this thread and I got it working using the custom location as demonstrated above. But today it stopped working (ie the headers are no longer working... I'm using it with CloudFlare if that's relevant) when I had to renew the certs.
Author
Owner

@R0GGER commented on GitHub (Apr 8, 2021):

+1

<!-- gh-comment-id:816130301 --> @R0GGER commented on GitHub (Apr 8, 2021): +1
Author
Owner

@jacqueshenning commented on GitHub (Apr 12, 2021):

I am facing the exact same dilemma.
Adding any header = "add_header" variables to "Edit Proxy Host" / Advanced
Has no effect.

<!-- gh-comment-id:817801137 --> @jacqueshenning commented on GitHub (Apr 12, 2021): I am facing the exact same dilemma. Adding any header = "add_header" variables to "Edit Proxy Host" / Advanced Has no effect.
Author
Owner

@gregfr commented on GitHub (Apr 21, 2021):

As I noted in my post from Sep 23, 2020, the problem is from Nginx itself, not NPM.

<!-- gh-comment-id:824005418 --> @gregfr commented on GitHub (Apr 21, 2021): As I noted in my post from Sep 23, 2020, the problem is from Nginx itself, not NPM.
Author
Owner

@skorvek commented on GitHub (Apr 21, 2021):

Well on my setup, those headers are in the main server block, not any location block. But they're still not being added. I copied these into the custom config section of the site definition in npm without any effect.

<!-- gh-comment-id:824379202 --> @skorvek commented on GitHub (Apr 21, 2021): Well on my setup, those headers are in the main server block, not any location block. But they're still not being added. I copied these into the custom config section of the site definition in npm without any effect.
Author
Owner

@R0GGER commented on GitHub (Apr 21, 2021):

As I noted in my post from Sep 23, 2020, the problem is from Nginx itself, not NPM.

No... I'm pretty sure it's a NGINX Proxy Manager bug. It's already in the code, but it's not working...

Code: github.com/jc21/nginx-proxy-manager@1a64d44857/backend/app.js (L34-L52)

When add the headers manually to a proxy_host config ( below # HSTS) it works perfectly fine...

add_header Referrer-Policy "no-referrer" always;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
<!-- gh-comment-id:824409280 --> @R0GGER commented on GitHub (Apr 21, 2021): > As I noted in my post from Sep 23, 2020, the problem is from Nginx itself, not NPM. No... I'm pretty sure it's a NGINX Proxy Manager bug. It's already in the code, but it's not working... **Code:** https://github.com/jc21/nginx-proxy-manager/blob/1a64d44857b8db488f56567b743f787b61e1f7a4/backend/app.js#L34-L52 When add the headers manually to a proxy_host config ( below # HSTS) it works perfectly fine... ``` add_header Referrer-Policy "no-referrer" always; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; ```
Author
Owner

@R0GGER commented on GitHub (Apr 21, 2021):

I created a workaround which works pretty well...
More info: Workaround - Security Headers @ NGINX Proxy Manager

Result:
eLo2Df

<!-- gh-comment-id:824434589 --> @R0GGER commented on GitHub (Apr 21, 2021): I created a workaround which works pretty well... More info: [Workaround - Security Headers @ NGINX Proxy Manager](https://gist.github.com/R0GGER/916183fca41f02df1471a6f455e5869f) **Result:** ![eLo2Df](https://user-images.githubusercontent.com/8298741/115926939-f4395080-a483-11eb-84d1-755c87714273.png)
Author
Owner

@jacqueshenning commented on GitHub (Apr 26, 2021):

As I noted in my post from Sep 23, 2020, the problem is from Nginx itself, not NPM.

Hi I am pretty sure its not NGINX, I setup NGINX SSL Proxies + WAF's often, if I manually add the headers to the server blocks, all works as expected, but this is not ideal as NPM is supposed to be the "easier" option vs custom / scratch setups.

Or if you could please give a more productive answer i.e. point me to where the NGINX issue is, I can then investigate or be more informed.

Kind Regards

<!-- gh-comment-id:826910600 --> @jacqueshenning commented on GitHub (Apr 26, 2021): > As I noted in my post from Sep 23, 2020, the problem is from Nginx itself, not NPM. Hi I am pretty sure its not NGINX, I setup NGINX SSL Proxies + WAF's often, if I manually add the headers to the server blocks, all works as expected, but this is not ideal as NPM is supposed to be the "easier" option vs custom / scratch setups. Or if you could please give a more productive answer i.e. point me to where the NGINX issue is, I can then investigate or be more informed. Kind Regards
Author
Owner

@dutch2005 commented on GitHub (Jun 30, 2021):

@jacqueshenning imo the person above you states what does work.

Is this still an issue by the way? (as I am yet to configure the settings stated above).

<!-- gh-comment-id:871257504 --> @dutch2005 commented on GitHub (Jun 30, 2021): @jacqueshenning imo the person above you states what does work. Is this still an issue by the way? (as I am yet to configure the settings stated above).
Author
Owner

@Kopernikus1979 commented on GitHub (Apr 8, 2022):

Hi,

I'm also using custom location and I'm getting A+ grade with these headers:

add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
proxy_hide_header X-Powered-By;
add_header 'Referrer-Policy' 'no-referrer';
add_header Permissions-Policy "accelerometer=();ambient-light-sensor=(); autoplay=();camera=();encrypted-media=();focus-without-user-activation=(); geolocation=();gyroscope=();magnetometer=();microphone=();midi=();payment=();picture-in-picture=(); speaker=();sync-xhr=();usb=();vr=()";
add_header Content-Security-Policy "default-src 'none'; style-src 'self' ; form-action 'self'; frame-ancestors 'self'; base-uri 'self'; img-src 'self' data:; font-src 'self'; frame-src 'self'";

and also

include conf.d/include/ssl-ciphers.conf; in the advanced tab otherwise it uses unsafe ciphers if I use a custom SSL cert instead of Let's Encrypt

<!-- gh-comment-id:1092707673 --> @Kopernikus1979 commented on GitHub (Apr 8, 2022): Hi, I'm also using custom location and I'm getting A+ grade with these headers: add_header X-Xss-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; proxy_hide_header X-Powered-By; add_header 'Referrer-Policy' 'no-referrer'; add_header Permissions-Policy "accelerometer=();ambient-light-sensor=(); autoplay=();camera=();encrypted-media=();focus-without-user-activation=(); geolocation=();gyroscope=();magnetometer=();microphone=();midi=();payment=();picture-in-picture=(); speaker=();sync-xhr=();usb=();vr=()"; add_header Content-Security-Policy "default-src 'none'; style-src 'self' ; form-action 'self'; frame-ancestors 'self'; base-uri 'self'; img-src 'self' data:; font-src 'self'; frame-src 'self'"; and also include conf.d/include/ssl-ciphers.conf; in the advanced tab otherwise it uses unsafe ciphers if I use a custom SSL cert instead of Let's Encrypt
Author
Owner

@niapapa commented on GitHub (Apr 9, 2022):

@Kopernikus1979 thanks for this, works like a charm!

<!-- gh-comment-id:1093970742 --> @niapapa commented on GitHub (Apr 9, 2022): @Kopernikus1979 thanks for this, works like a charm!
Author
Owner

@Kopernikus1979 commented on GitHub (Apr 11, 2022):

@Kopernikus1979 thanks for this, works like a charm!

Your welcome :-)

It's possible that the add_header Content-Security-Policy "default-src 'none'; style-src 'self' ; form-action 'self'; frame-ancestors 'self'; base-uri 'self'; img-src 'self' data:; font-src 'self'; frame-src 'self'"; needs tweaking (define allowed) for some services/apps, otherwise youc an replace it with add_header Content-Security-Policy upgrade-insecure-requests;

<!-- gh-comment-id:1095185765 --> @Kopernikus1979 commented on GitHub (Apr 11, 2022): > @Kopernikus1979 thanks for this, works like a charm! Your welcome :-) It's possible that the add_header Content-Security-Policy "default-src 'none'; style-src 'self' ; form-action 'self'; frame-ancestors 'self'; base-uri 'self'; img-src 'self' data:; font-src 'self'; frame-src 'self'"; needs tweaking (define allowed) for some services/apps, otherwise youc an replace it with add_header Content-Security-Policy upgrade-insecure-requests;
Author
Owner

@HopperShell commented on GitHub (Sep 23, 2022):

The only way i got this working is by manually adjusting the .conf. Can anyone explain what the custom location even means? What exactly is the IP address supposed to be?

<!-- gh-comment-id:1256647012 --> @HopperShell commented on GitHub (Sep 23, 2022): The only way i got this working is by manually adjusting the .conf. Can anyone explain what the custom location even means? What exactly is the IP address supposed to be?
Author
Owner

@niapapa commented on GitHub (Sep 24, 2022):

Hi @andrewwarz - The custom location is located inside Nginx Proxy Manager where you create the proxy hosts.

image

I have added the following to my configuration.

add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
proxy_hide_header X-Powered-By;
add_header 'Referrer-Policy' 'no-referrer';
add_header Permissions-Policy "accelerometer=();ambient-light-sensor=(); autoplay=();camera=();encrypted-media=();focus-without-user-activation=(); geolocation=();gyroscope=();magnetometer=();microphone=();midi=();payment=();picture-in-picture=(); speaker=();sync-xhr=();usb=();vr=()";
add_header Content-Security-Policy upgrade-insecure-requests;

image

Hope it helps.

<!-- gh-comment-id:1256881720 --> @niapapa commented on GitHub (Sep 24, 2022): Hi @andrewwarz - The custom location is located inside Nginx Proxy Manager where you create the proxy hosts. ![image](https://user-images.githubusercontent.com/76902176/192083686-88668ecd-a920-41bf-a8d8-9f245891c66d.png) I have added the following to my configuration. add_header X-Xss-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; proxy_hide_header X-Powered-By; add_header 'Referrer-Policy' 'no-referrer'; add_header Permissions-Policy "accelerometer=();ambient-light-sensor=(); autoplay=();camera=();encrypted-media=();focus-without-user-activation=(); geolocation=();gyroscope=();magnetometer=();microphone=();midi=();payment=();picture-in-picture=(); speaker=();sync-xhr=();usb=();vr=()"; add_header Content-Security-Policy upgrade-insecure-requests; ![image](https://user-images.githubusercontent.com/76902176/192083799-a1a7deb8-2234-4db8-b757-1a9e903107c9.png) Hope it helps.
Author
Owner

@sebtech33 commented on GitHub (Dec 5, 2022):

Tested this myself and i cant get more than B rating.

I have tried the workaround that @R0GGER posted and what @NiapApa said, both failed me.

Is there any progress done on this?

I'm on npm version 2.9.19 and the problem is still there

<!-- gh-comment-id:1336654406 --> @sebtech33 commented on GitHub (Dec 5, 2022): Tested this myself and i cant get more than B rating. I have tried the workaround that @R0GGER posted and what @NiapApa said, both failed me. Is there any progress done on this? I'm on npm version 2.9.19 and the problem is still there
Author
Owner

@JPDucky commented on GitHub (Feb 27, 2023):

Also on 2.9.19 and none of the workarounds specified above work.

<!-- gh-comment-id:1447229679 --> @JPDucky commented on GitHub (Feb 27, 2023): Also on 2.9.19 and none of the workarounds specified above work.
Author
Owner

@adley20 commented on GitHub (May 1, 2023):

Installed v2.10.2 and followed @R0GGER workaround. Thx

Aplus

I found adding 'always' on the end of for nginx works :-

{% if certificate and certificate_id > 0 -%}
{% if ssl_forced == 1 or ssl_forced == true %}
{% if hsts_enabled == 1 or hsts_enabled == true %}
add_header Strict-Transport-Security "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Content-Security-Policy upgrade-insecure-requests always;
add_header Permissions-Policy interest-cohort=() always;
add_header Expect-CT 'enforce; max-age=604800' always;
more_set_headers 'Server: Proxy';
more_clear_headers 'X-Powered-By';
{% endif %}
{% endif %}
{% endif %}

I hope it helps....

<!-- gh-comment-id:1530471761 --> @adley20 commented on GitHub (May 1, 2023): Installed v2.10.2 and followed @R0GGER workaround. Thx ![Aplus](https://user-images.githubusercontent.com/132309497/235543988-9a3c9b94-5345-4eca-b575-f63a6ed6aa22.JPG) I found adding '**always**' on the end of for nginx works :- {% if certificate and certificate_id > 0 -%} {% if ssl_forced == 1 or ssl_forced == true %} {% if hsts_enabled == 1 or hsts_enabled == true %} add_header Strict-Transport-Security "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always; add_header Referrer-Policy strict-origin-when-cross-origin always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Content-Security-Policy upgrade-insecure-requests always; add_header Permissions-Policy interest-cohort=() always; add_header Expect-CT 'enforce; max-age=604800' always; more_set_headers 'Server: Proxy'; more_clear_headers 'X-Powered-By'; {% endif %} {% endif %} {% endif %} I hope it helps....
Author
Owner

@kristoftorok commented on GitHub (Jun 15, 2023):

Just use headers more.

more_set_headers "X-XSS-Protection: 1; mode=block";
more_set_headers "X-Content-Type-Options: nosniff";
more_set_headers "Referrer-Policy: no-referrer-when-downgrade";
more_set_headers "Content-Security-Policy: default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';";
more_set_headers "Permissions-Policy: interest-cohort=()";
more_set_headers "Strict-Transport-Security: max-age=31536000; includeSubDomains";

<!-- gh-comment-id:1593766894 --> @kristoftorok commented on GitHub (Jun 15, 2023): Just use headers more. more_set_headers "X-XSS-Protection: 1; mode=block"; more_set_headers "X-Content-Type-Options: nosniff"; more_set_headers "Referrer-Policy: no-referrer-when-downgrade"; more_set_headers "Content-Security-Policy: default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';"; more_set_headers "Permissions-Policy: interest-cohort=()"; more_set_headers "Strict-Transport-Security: max-age=31536000; includeSubDomains";
Author
Owner

@sinnayuh commented on GitHub (Feb 10, 2024):

Having an issue with adding custom headers, whenever i add a custom location "/" and add the headers there i get this page when trying to visit the site.

image

<!-- gh-comment-id:1937025376 --> @sinnayuh commented on GitHub (Feb 10, 2024): Having an issue with adding custom headers, whenever i add a custom location "/" and add the headers there i get this page when trying to visit the site. ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/92541374/b7c2f57a-7791-46a9-9b18-6ff1f111fdfb)
Author
Owner

@Nazgile94 commented on GitHub (Apr 5, 2024):

damn, is this still an issue 2024???

<!-- gh-comment-id:2040300780 --> @Nazgile94 commented on GitHub (Apr 5, 2024): damn, is this still an issue 2024???
Author
Owner

@Kopernikus1979 commented on GitHub (Apr 6, 2024):

Yeah, still not fixed you can add them manually like I do

<!-- gh-comment-id:2041038985 --> @Kopernikus1979 commented on GitHub (Apr 6, 2024): Yeah, still not fixed you can add them manually like I do
Author
Owner

@ALERTua commented on GitHub (Apr 7, 2024):

If someone is here for Nextcloud, as I am, here's the solution:
Just paste this in the NPM Advanced tab for your hostname:

location /.well-known/carddav {    
    return 301 $scheme://$host/remote.php/dav;}

location /.well-known/caldav {    
    return 301 $scheme://$host/remote.php/dav;}

more_set_headers "X-XSS-Protection: 1; mode=block";
more_set_headers "X-Content-Type-Options: nosniff";
more_set_headers "X-Robots-Tag: noindex, nofollow";
more_set_headers "Referrer-Policy: no-referrer-when-downgrade";
more_set_headers "Content-Security-Policy: default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';";
more_set_headers "Permissions-Policy: interest-cohort=()";
more_set_headers "Strict-Transport-Security: max-age=31536000; includeSubDomains";
more_set_headers "X-Frame-Options: SAMEORIGIN";
more_set_headers "X-Permitted-Cross-Domain-Policies: none";
<!-- gh-comment-id:2041376380 --> @ALERTua commented on GitHub (Apr 7, 2024): If someone is here for Nextcloud, as I am, here's the solution: Just paste this in the NPM Advanced tab for your hostname: ``` location /.well-known/carddav { return 301 $scheme://$host/remote.php/dav;} location /.well-known/caldav { return 301 $scheme://$host/remote.php/dav;} more_set_headers "X-XSS-Protection: 1; mode=block"; more_set_headers "X-Content-Type-Options: nosniff"; more_set_headers "X-Robots-Tag: noindex, nofollow"; more_set_headers "Referrer-Policy: no-referrer-when-downgrade"; more_set_headers "Content-Security-Policy: default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline'; frame-ancestors 'self';"; more_set_headers "Permissions-Policy: interest-cohort=()"; more_set_headers "Strict-Transport-Security: max-age=31536000; includeSubDomains"; more_set_headers "X-Frame-Options: SAMEORIGIN"; more_set_headers "X-Permitted-Cross-Domain-Policies: none"; ```
Author
Owner

@boogipro commented on GitHub (Oct 25, 2024):

Still not fixed? Ohh boy

<!-- gh-comment-id:2438909061 --> @boogipro commented on GitHub (Oct 25, 2024): Still not fixed? Ohh boy
Author
Owner

@krokhale commented on GitHub (Nov 18, 2024):

For anyone coming across this, I got this working by moving to Caddy, though if you were to use the dockerized version of Caddy, you will come across the same issue. I had to use a non dockerized version. My guess is that a non dockerized version of NPM would probably work fine as well but Caddy really feels intuitive to me now. Good luck!

<!-- gh-comment-id:2483091323 --> @krokhale commented on GitHub (Nov 18, 2024): For anyone coming across this, I got this working by moving to Caddy, though if you were to use the dockerized version of Caddy, you will come across the same issue. I had to use a non dockerized version. My guess is that a non dockerized version of NPM would probably work fine as well but Caddy really feels intuitive to me now. Good luck!
Author
Owner

@github-actions[bot] commented on GitHub (Jun 21, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2993253042 --> @github-actions[bot] commented on GitHub (Jun 21, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@gthvidsten commented on GitHub (Jul 28, 2025):

Another comment to keep this open as I just encountered this issue myself.

<!-- gh-comment-id:3128510375 --> @gthvidsten commented on GitHub (Jul 28, 2025): Another comment to keep this open as I just encountered this issue myself.
Author
Owner

@halisidd commented on GitHub (Oct 27, 2025):

the suggestion by @kristoftorok worked for me. v2.12.2

<!-- gh-comment-id:3451584031 --> @halisidd commented on GitHub (Oct 27, 2025): the suggestion by @kristoftorok worked for me. v2.12.2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#489
No description provided.