I'm building a chrome extension that integrates with the notion API. Since the notion API blocks requests from browsers, I want to set up a forward proxy as a middleman between my extension and the notion API. For that I am using NGINX and docker but the Authorization
header required by the notion API is not being forwarded.
Docker file:
FROM nginx:latest
COPY nginx.conf /etc/nginx/nginx.conf
NGINX config
events {
worker_connections 1024;
}
http {
server {
listen 8080;
server_name localhost;
location / {
resolver 8.8.8.8;
proxy_pass http://api.notion.com/;
proxy_set_header Host api.notion.com;
proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;
proxy_pass_request_headers on;
}
}
}
Since the Authorization header is not being passed, even though I am sure I'm passing it in the request, nginx still does not forward it but does forward other headers such as Notion-Version
, and so notion returns an unauthorized access response
Is there something wrong with the nginx config file? There isn't much support for nginx when used as a forward proxy