question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"proxy_pass" directive is not allowed

See original GitHub issue

I wanted to make a proxy host for calibre-web docker - https://docs.linuxserver.io/images/docker-calibre-web Based on their documentation for NGINX there I added code to the proxy host config file (of course I replaced my IP)

        location /calibre-web {
                proxy_pass              http://<your-ip>:8083;
                proxy_set_header        Host            $http_host;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Scheme        $scheme;
                proxy_set_header        X-Script-Name   /calibre-web;
        }

After that, I am not able to run the NGINX app correctly. I found the error message in the log.

nginx: [emerg] “proxy_pass” directive is not allowed here in /etc/nginx/conf.d/include/proxy.conf:7

How can I fix it? Thank you

NGINX docker is updated to the latest version today.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
vawavercommented, Jun 1, 2021

Thank you for your help. Finally, I have found a working solution for myself.

  1. Set Cloudflare to “DNS Only” for my subdomain (losing Cloudflare protection)
  2. Get a new certificate for my subdomain in NGINX proxy
  3. Put the code to Advanced -> Custom config configuration
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

Now it seems to work fine without pushing me to the login screen. Maybe it will help the others.

0reactions
chaptergycommented, May 31, 2021

Unfortunately I have no other ideas. But I found this issue which is exactly your problem: https://github.com/jc21/nginx-proxy-manager/issues/854. Not sure what to make of it, it seems that it might be an issue with the authentication mechanism of calibre web? I also found this page, maybe this will help you? But I don’t think I can provide any further help, sorry.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nginx: [emerg] "proxy_pass" directive is not allowed here ...
I know the directive proxy_pass is not allowed in a server block , the problem is why this affect nginx-ingress-controller reload config。 if...
Read more >
1 - Stack Overflow
proxy_pass is allowed in a location context server { listen 192.168.1.99:25672; # proxy_ssl_certificate /etc/ssl/certs/rabbit-client.cert.pem; ...
Read more >
nginx server directive is not allowed here
I'm following an article on setting up nginx as reverse proxy with apache. And I get this error: nginx: [emerg] "server" directive is...
Read more >
nginx: [emerg] "proxy_pass" directive is not allowed here in
I found the error message in the log. nginx: [emerg] "proxy_pass" directive is not allowed here in /etc/nginx/conf.d/include/proxy.conf: .
Read more >
nginx: [emerg] "stream" directive is not allowed here - Reddit
I am trying to simply proxy pass a tcp connection. I get the error message: nginx: [emerg] "stream" directive is not allowed here....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found