Skip to content

proxy to static nginx:latest container returns 500 always #185

New issue

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

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

Already on GitHub? # to your account

Closed
H3npi opened this issue Jan 27, 2020 · 6 comments
Closed

proxy to static nginx:latest container returns 500 always #185

H3npi opened this issue Jan 27, 2020 · 6 comments

Comments

@H3npi
Copy link

H3npi commented Jan 27, 2020

hi all,

Error description:

i created a docker-compose.yml to proxy a static website through "nginx-web".
The file looks like this:

version: '3.3'
services:
    hvoss.dev:
      container_name: hvoss.dev
      restart: always
      image: nginx:latest
      volumes:
        - "./www:/usr/share/nginx/html:ro"
      environment:
        - VIRTUAL_HOST=hvoss.dev
        - LETSENCRYPT_HOST=hvoss.dev

networks:
  default:
    external:
      name: webproxy

i'd expect that "nginx-gen" generates a config which will proxy-pass to the container, but the generated config looks like this_

# hvoss.dev
upstream hvoss.dev {
				# Cannot connect to network of this container
				server 127.0.0.1 down;
				# Cannot connect to network of this container
				server 127.0.0.1 down;
				## Can be connected with "webproxy" network
			# hvoss.dev
			server 172.19.0.5:80;
}
server {
	server_name hvoss.dev;
	listen 80 ;
	access_log /var/log/nginx/access.log vhost;
	include /etc/nginx/vhost.d/default;
	location / {
		proxy_pass http://hvoss.dev;
	}
}
server {
	server_name hvoss.dev;
	listen 443 ssl http2 ;
	access_log /var/log/nginx/access.log vhost;
	return 500;
	ssl_certificate /etc/nginx/certs/default.crt;
	ssl_certificate_key /etc/nginx/certs/default.key;
}

Steps to reproduce

Setup latest proxy. Create a new dir www. Put a index.html in it.
Create a docker-compose.yml like above.
Start the container docker-compse -up -d

Expected result

a working default.conf should be generated

Error result

  • website is not accessible
  • cannot generate ssl certificate due to error above

Comments

when curling the container on the host machine via the internal ip like curl 172.19.0.5:80 everything works fine.

@paradoxina
Copy link

@H3npi
Copy link
Author

H3npi commented Jan 28, 2020

jwilder/docker-gen#317 (comment)

I am not using docker for windows.
Currently i got docker version 19.03.5

@paradoxina
Copy link

paradoxina commented Jan 28, 2020

jwilder/docker-gen#317 (comment)

I am not using docker for windows.
Currently i got docker version 19.03.5

#186 (comment)

@H3npi
Copy link
Author

H3npi commented Jan 30, 2020

jwilder/docker-gen#317 (comment)
I am not using docker for windows.
Currently i got docker version 19.03.5

#186 (comment)

I guess this is not the same issue.

@evertramos
Copy link
Owner

check and post here your logs in nginx-letsencrypt

@H3npi
Copy link
Author

H3npi commented Feb 3, 2020

@evertramos This Issue can be closed.

There was a dns proxy installed, therefore the letsencrypt generation could not work.

@H3npi H3npi closed this as completed Feb 3, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants