mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 09:55:51 +03:00
[GH-ISSUE #202] Access-Control-Allow-Origin on the default location "/" #176
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#176
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Appyx on GitHub (Sep 22, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/202
I want to modify the header Access-Control-Allow-Origin on the default location "/". But this is not possible without entering the global context and thus, the "deeper" location context is used, making my modification useless.
At least I guess that's the problem.
I tried adding the following in the Advanced section:
add_header 'Access-Control-Allow-Origin' '*' always;Is there a trick to allow cross domain requests?
Edit:
I found the trick :)
I added the header as a custom location at path "/" that targets the same server.
However, this feels really "hacky".
Edit2:
It would be cool to have a GUI option for embedding the server as an iFrame without touching the advanced section as well as having an option for CORS.
@sign0 commented on GitHub (Sep 7, 2020):
Unfortunately using
location / { ... }seems to "break" the auth_basic (configured from GUI)@chaptergy commented on GitHub (Oct 25, 2021):
As this issue is resolved (using the
/location block, which is not a hacky way around things but the suggested option) I'll close it. For a feature request of having a dedicated GUI option, see https://github.com/jc21/nginx-proxy-manager/issues/379.@meichthys commented on GitHub (Feb 3, 2022):
If anyone has this working, could you please provide a screenshot?
@Codename-11 commented on GitHub (Jun 17, 2022):
After a lot of digging around and attempts at using the "Advanced" tab to add
add_header 'Access-Control-Allow-Origin' '*';, to no avail, I finally attempted adding a custom location under the host, which finally worked!This was all in the effort of having my Homer dashboard be able to display statistics from Uptime-Kuma, but I kept getting the error that the Access-Control-Allow-Origin was not set on the remote resource. I thought doing so under the Advanced tab would do the trick but that wasn't the case it seems. It immediately worked after setting it up under custom locations. Hopefully this helps someone!