[GH-ISSUE #917] Setting exceptions for a particular path #775

Closed
opened 2026-02-26 06:34:22 +03:00 by kerem · 1 comment
Owner

Originally created by @deathg0d on GitHub (Feb 25, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/917

I want to add CORS to a particular path, not the entire domain. Right now I am using the following configuration:

location /fonts/ {
   proxy_pass                          http://internal-server:8000;
   proxy_http_version                  1.1;
   client_max_body_size                1m;
   # Allow origin from anywhere
   add_header Access-Control-Allow-Origin *;
}

However, this replaces the entire setting for the route? How do I add only add_header Access-Control-Allow-Origin *; to this particular route and use rest of the default domain level settings?

Also, how do I add this header to websockets?

Originally created by @deathg0d on GitHub (Feb 25, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/917 I want to add CORS to a particular path, not the entire domain. Right now I am using the following configuration: ``` location /fonts/ { proxy_pass http://internal-server:8000; proxy_http_version 1.1; client_max_body_size 1m; # Allow origin from anywhere add_header Access-Control-Allow-Origin *; } ``` However, this replaces the entire setting for the route? How do I add only `add_header Access-Control-Allow-Origin *;` to this particular route and use rest of the default domain level settings? Also, how do I add this header to websockets?
kerem 2026-02-26 06:34:22 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@github-actions[bot] commented on GitHub (Mar 18, 2024):

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

<!-- gh-comment-id:2002735415 --> @github-actions[bot] commented on GitHub (Mar 18, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
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#775
No description provided.