Heroku + Node (Parse server) + nginx does not work

I know there is a similar question, but this question is more specific, because I have nginx server installed, but the location parameters do not affect:

Here is my nginx.conf.erb :

 daemon off; #Heroku dynos have at least 4 cores. worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; events { use epoll; accept_mutex on; worker_connections 1024; } http { gzip on; server_tokens off; log_format l2met 'measure#nginx.service=$request_time request_id=$http_x_request_id'; access_log logs/nginx/access.log l2met; error_log logs/nginx/error.log; include mime.types; default_type application/octet-stream; sendfile on; #Must read the body in 5 seconds. client_body_timeout 5; upstream app_server { server unix:/tmp/nginx.socket fail_timeout=0; } server { listen <%= ENV["PORT"] %>; server_name _; keepalive_timeout 5; # A try to override some pictures in parse # location /parse/files/0B5jvlihE6yxQed1w9vRSRW0DRldy3fbwqaCjpyF/ { # add_header whereamI first; # return 301 http://www.immobleupromotion.com/wp-content/uploads/2016/07/nice-ouest.jpg; # } # location /parse/files/{ # add_header whereamI second; # return 301 http://www.immobleupromotion.com/wp-content/uploads/2016/07/nice-ouest.jpg; # } # location / { # add_header whereamI parent; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header Host $http_host; # proxy_redirect off; # proxy_pass http://app_server; # } } } 

Here is my Procfile:

 web: bin/start-nginx ./node_modules/.bin/forever index.js 

Here is my index.js (at least the relevant part):

 var httpServer = require('http').createServer(app); httpServer.listen('/tmp/nginx.socket', function () { fs.openSync('/tmp/app-initialized', 'w'); }); 

Last but not least, here are my buildpacks

 === super-project Buildpack URLs 1. https://github.com/heroku/heroku-buildpack-nodejs.git 2. https://github.com/heroku/heroku-buildpack-nginx.git 

And the problem is ... it works : the server returns through nginx all the desired answers BUT , basically it should not, because it means that nginx proxy is absolutely useless, and I can not understand why.

Any ideas?

+1
nginx heroku
source share

No one has answered this question yet.

See similar questions:

8
Did you manage to configure the node nginx proxy server setting on Heroku?

or similar:

1039
Using node.js as a simple web server
1001
Why do people use Heroku when AWS is present? What sets Heroku apart from AWS?
954
Node.js + Nginx - What Now?
890
How to parse JSON using Node.js?
867
How to remove npm modules in js node?
818
Permission denied (publickey) when deploying heroku code. fatal: the far end unexpectedly hung up
786
How to link a folder to an existing Heroku application
451
heroku - how to view all logs
one
Permanent migration of Wordpress with nginx upstream
0
Nginx erorr 404 not found

All Articles