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 blocks the port #76

Open
bbreton3 opened this issue Aug 6, 2018 · 0 comments
Open

nginx proxy_pass blocks the port #76

bbreton3 opened this issue Aug 6, 2018 · 0 comments

Comments

@bbreton3
Copy link

bbreton3 commented Aug 6, 2018

I am trying to host the Tensorboard on a Heroku instance, and to secure it, I have added nginx using the nginx-buildpack in front of it.
The idea is that Tensorboard will create the app on port 6006, and Nginx will redirect this port to the external port provided by Heroku $Port.

When I start the app, I have the following error:

TensorBoard attempted to bind to port 6006, but it was already in use

My config files are as follows:

Procfile

web: bin/start-nginx tensorboard --logdir="/app/" --host=http://127.0.0.1 --port=6006

config/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;
    gzip_comp_level 2;
    gzip_min_length 512;

        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 http://127.0.0.1;
	        keepalive_timeout 5;
	        root   /app;
	        port_in_redirect off;
        #index  index.html index.htm;

	    location = / {
		    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		    proxy_set_header Host $http_host;
		    proxy_redirect off;
		    proxy_pass http://127.0.0.1:6006;
	    }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant