# After update to 8.3.5: 'Origin not allowed' behind proxy

**URL:** <https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598>\
**Category:** Configuration\
**Tags:** reverse-proxy, backend-platform\
**Created:** [February 10, 2022, 5:50pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598 "2022-02-10T17:50:24Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaapd](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jaapd](https://community.grafana.com/u/jaapd)\
**Post date:** [February 10, 2022, 5:50pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/1 "2022-02-10T17:50:24Z")

</div>

Last week Grafana worked without any problems, but after the update to 8.3.5 I cannot log in anymore. In the login screen, after entering my username and password a message appeared: ‘Origin not allowed’. In the grafana.log file I see a line:  
`lvl=eror msg="Failed to look up user based on cookie" logger=context error="user token not found" `

This happens behind a proxy. If I connect directly (via port 3000) everytings works fine.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [February 10, 2022, 8:36pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/2 "2022-02-10T20:36:59Z")

</div>

Hello 👋 and welcome to the forum, @jaapd

This is a known issue with 8.3.6. See this github issue for a workaround.

tl:dr: try adding `proxy_set_header Host $http_host;` to your config above `proxy_pass`:

> <https://github.com/grafana/grafana/issues/45117#issuecomment-1033842787>
>
> \*\*What happened\*\*:
> Unable to create a new dashboard or save changes to existing… dashboards following update to Grafana v8.3.5 
> 
> \*\*What you expected to happen\*\*:
> Ability to create/modify dashboards in Grafana
> 
> \*\*How to reproduce it (as minimally and precisely as possible)\*\*:
> \- Log into Grafana instance and click on "+" button and create new dashboard
> \- Go to save the dashboard into a folder
> \- Attempt to save fails, "Origin Not Allowed" error shows up in upper right corner
> 
> \*\*Anything else we need to know?\*\*:
> Attached is what I'm seeing in the console upon trying to save; looks like it is getting a 403 Forbidden for FQDN/api/dashboards/db and this is preventing dashboard from saving. Clicking the "Save" button prompts one of these errors in the console. I'm also seeing a 403 Forbidden on FQDN/api/frontend-metrics and a screenshot for that is attached too. I'm not seeing anything of particular use in the /var/log/grafana/grafana.log at INFO level, let me know if I should try debug level.  
> \<img width="1676" alt="Screen Shot 2022-02-08 at 10 26 05 PM" src="https://user-images.githubusercontent.com/16138910/153122711-779a4b11-48f3-4071-a5da-b7dd218859de.png"\>
> \<img width="1675" alt="Screen Shot 2022-02-08 at 10 31 46 PM" src="https://user-images.githubusercontent.com/16138910/153122716-9a93814d-2712-43ee-83cf-6883646cfb9c.png"\>
> 
> 
> \*\*Environment\*\*:
> \- Grafana version: 8.3.5
> \- Data source type & version: InfluxDB
> \- OS Grafana is installed on: RHEL 8
> \- User OS & Browser: Safari, Chrome
> \- Grafana plugins: None
> \- Others: None

---

<div class="post-metadata">

**Author:** ![jaapd](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jaapd](https://community.grafana.com/u/jaapd)\
**Post date:** [February 11, 2022, 3:30pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/3 "2022-02-11T15:30:41Z")

</div>

Thanks, it works again!

---

<div class="post-metadata">

**Author:** ![tajsidkazi](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@tajsidkazi](https://community.grafana.com/u/tajsidkazi)\
**Post date:** [February 21, 2022, 6:28am UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/4 "2022-02-21T06:28:44Z")

</div>

Hi I upgraded from 8.1 to 8.4.1 but I am still facing this ‘Origin Not Allowed’ error even after adding proxy\_set\_header Host $http\_host; in Nginx config file the server block is listening on 443

server{  
listen 443 ssl;  
server\_name [example.com](http://example.com);  
.  
.  
ssl\_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot  
root /usr/share/nginx/html;  
index index.html index.htm;

location / {  
proxy\_set\_header Host $http\_host; //added after upgrade from 8.1 to 8.4.1 for origin not allowed error

proxy\_pass [https://community.grafana.com/;](https://community.grafana.com/;)

}

Its still showing Origin Not Allowed Error

---

<div class="post-metadata">

**Author:** ![gotenk](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/gotenk/32/17913_2.png) [@gotenk](https://community.grafana.com/u/gotenk)\
**Post date:** [March 5, 2022, 8:18am UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/5 "2022-03-05T08:18:44Z")

</div>

Still the same error even after adding the line in my vhost. Any other suggestions?

---

<div class="post-metadata">

**Author:** ![arthursens](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@arthursens](https://community.grafana.com/u/arthursens)\
**Post date:** [March 6, 2022, 7:53am UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/6 "2022-03-06T07:53:51Z")

</div>

Hello hello 👋

I’m running Grafana 8.4.2 on a KinD cluster inside Github Codespaces, I’m not sure I have access to any proxy in that environment.

I get ‘Origin not allowed’ when testing a Prometheus datasource running on the same namespace. (Although metric auto-completion works 🤔 )

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/2/2/2218b29d31ecff5976ec6b975f44b8989e8cbc86.png)  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/6/7/678ee397ba7aede7da6ef5318aa62ab92b2a90d7.png)

Is there a workaround for such case?

---

<div class="post-metadata">

**Author:** ![ssedrick](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@ssedrick](https://community.grafana.com/u/ssedrick)\
**Post date:** [April 5, 2022, 1:00pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/7 "2022-04-05T13:00:19Z")

</div>

In addition to this, on apache2 u add the following line

…  
  
ProxyPreserveHost On  
ProxyPass [http://127.0.0.1:3000/](http://127.0.0.1:3000/)  
ProxyPassReverse [http://127.0.0.1:3000/](http://127.0.0.1:3000/)  
  
…

---

<div class="post-metadata">

**Author:** ![glidenmm](https://avatars.discourse-cdn.com/v4/letter/g/90db22/32.png) [@glidenmm](https://community.grafana.com/u/glidenmm)\
**Post date:** [April 15, 2022, 9:54pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/9 "2022-04-15T21:54:23Z")

</div>

You sould restart nginx, sudo sudo systemctl restart nginx.service

---

<div class="post-metadata">

**Author:** ![lukelu](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@lukelu](https://community.grafana.com/u/lukelu)\
**Post date:** [April 26, 2022, 8:12am UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/10 "2022-04-26T08:12:39Z")

</div>

I found a way workaround for myself and you can try this:  
in your Nginx configuration file using the real domain name replace the $http\_host and restart Nginx

```auto
# proxy_set_header Host $http_host;
proxy_set_header Host example.com;

```

It worked for me, hope it can help you also.

---

<div class="post-metadata">

**Author:** ![kmorin18](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/kmorin18/32/23223_2.png) [@kmorin18](https://community.grafana.com/u/kmorin18)\
**Post date:** [May 14, 2022, 1:03am UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/11 "2022-05-14T01:03:20Z")

</div>

This worked, Thanks !!

---

<div class="post-metadata">

**Author:** ![superg28dm](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@superg28dm](https://community.grafana.com/u/superg28dm)\
**Post date:** [July 8, 2022, 1:52pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/12 "2022-07-08T13:52:17Z")

</div>

Did you get a work around for this? Have a similar issue in an AKS cluster at the moment

---

<div class="post-metadata">

**Author:** ![tiovinamatos](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@tiovinamatos](https://community.grafana.com/u/tiovinamatos)\
**Post date:** [July 27, 2022, 8:02pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/13 "2022-07-27T20:02:20Z")

</div>

Thanks, valid solution for 9.0.3 as well. 😃

---

<div class="post-metadata">

**Author:** ![dilipssn](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@dilipssn](https://community.grafana.com/u/dilipssn)\
**Post date:** [December 15, 2022, 11:57am UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/14 "2022-12-15T11:57:26Z")

</div>

Hi Guys,

The grafana (grafana-7.5.11-2.el8.rpm) package we have updated it to the below-mentioned version with dependency.

grafana-pcp-3.2.0-2.el8.x86\_64.rpm  
grafana-7.5.15-3.el8.x86\_64.rpm

We are using “Graphite” as DB to connect with Grafana. It worked until we use old version (grafana-7.5.11-2.el8.rpm) and post to the update, the databse connection not worked.

During graphite connection, I get the error “origin not allowed”. also Attached here.

Could you please help us on fixing this issue…

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/1/f/1f75ec5a20c31a306df9f28d405dec9ad47772e9.png)

---

<div class="post-metadata">

**Author:** ![kirankumarpamula](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@kirankumarpamula](https://community.grafana.com/u/kirankumarpamula)\
**Post date:** [December 15, 2022, 11:58am UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/15 "2022-12-15T11:58:10Z")

</div>

Hi Experts,

We have upgraded grafana package from grafana-7.5.11-2.el8.rpm to grafana-7.5.15-3.el8.x86\_64.rpm along with taking care of its dependency package to grafana-pcp-3.2.0-2.el8.x86\_64.rpm, and we are seeing the same error “Origin not allowed” post upgrade.,

Actually, we are using “Graphite” as DB to connect with Grafana. It worked until we use old version (grafana-7.5.11-2.el8.rpm ) and post to the update to new version(7.5.15-3.el8.x86\_64.rpm), the databse connection not worked. During graphite connection, I get the error “origin not allowed” as attached here.

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/1/f/1f75ec5a20c31a306df9f28d405dec9ad47772e9.png)

---

<div class="post-metadata">

**Author:** ![jrblanno](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@jrblanno](https://community.grafana.com/u/jrblanno)\
**Post date:** [March 10, 2023, 10:24pm UTC](https://community.grafana.com/t/after-update-to-8-3-5-origin-not-allowed-behind-proxy/60598/16 "2023-03-10T22:24:11Z")

</div>

Hi!  
This is the correct way of fixing the issue. AMAZING!  
I had been searching for an answer but based on using istio instead of nginx , so here’s the same config but with an Istio Virtual Service:

the proxy\_set\_header FQDN ( or $http\_host ) in istio is configured in the http headers section

```auto
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  generation: 4
  labels:
  name: mynameofVS
  namespace: mynamespace
  spec:
  gateways:
    - mygateway
  hosts:
    - '*'
  http:
    - headers:
        request:
          add:
            Host: my.fqdn.com
      match:
        - uri:
            prefix: /grafana
      route:
        - destination:
            host: grafana.svc
            port:
              number: 80

```
