Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx proxy_pass stop working when compiled with passenger 5.0.0.rc2 #1393

trongrg opened this issue Feb 28, 2015 · 4 comments

nginx proxy_pass stop working when compiled with passenger 5.0.0.rc2 #1393

trongrg opened this issue Feb 28, 2015 · 4 comments


Copy link

trongrg commented Feb 28, 2015


  • OS: Centos 7
  • rvm: 1.26.10
  • ruby: 2.2.0
  • gem install passenger -v 5.0.0.rc2
  • passenger-install-nginx-module
  • choose recommended options (install nginx 1.6.2)
  • add a server directive
server {
  listen 80;
  server_name localhost;
  location / {
    proxy_pass http://localhost:9000;
  • restart nginx

When I run curl -I localhost, it always return 404.

Passenger 4.0.59 works as expected

Copy link

What happens if you remove the passenger_root directive from your Nginx config file? Does that make proxy_pass work again?

Copy link

trongrg commented Mar 1, 2015

@FooBarWidget Removing passenger_root directive from Nginx config file doesn't help

Following is a minimal nginx config that can reproduce the problem

worker_processes  1;
events {
    worker_connections  1024;
http {
    #passenger_root /usr/local/rvm/gems/ruby-2.2.0@global/gems/passenger-5.0.0.rc2;
    #passenger_ruby /usr/local/rvm/gems/ruby-2.2.0@global/wrappers/ruby;

    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;
        location / {

curl command, it doesn't show content from proxy_pass, but always serves content from nginx

curl localhost
<!DOCTYPE html>
<title>Welcome to nginx!</title>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href=""></a>.<br/>
Commercial support is available at
<a href=""></a>.</p>

<p><em>Thank you for using nginx.</em></p>

Copy link

Problem reproduced. Working on a fix.

Copy link

This issue has been fixed. There are several issues at work here.

The first is that your proxy_pass config had no effect even though Passenger is not enabled. This has been fixed.

The other issue is that passenger_enabled overrides the handler already set by another Nginx module, such as proxy_pass. This has also been fixed, by making sure that passenger_enabled directives are only inherited if no handler has already been set.

oshchukin pushed a commit to oshchukin/passenger that referenced this issue Mar 4, 2015
…ction even when it shouldn't

For example when Passenger is disabled. Closes phusionGH-1393.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants