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

port 80 is not detected #290

Closed
Silocan opened this issue Aug 31, 2018 · 1 comment
Closed

port 80 is not detected #290

Silocan opened this issue Aug 31, 2018 · 1 comment

Comments

@Silocan
Copy link

Silocan commented Aug 31, 2018

Hi,
I've got an docker-composer.yml with 2 services : 1 nginx on port 80 and 1 php-fpm on port 9000 on mydomain.com.
This is the code generated by docker-gen for mydomain.com and the port 80 is not defined (if i add it manually, that's work)

# mydomain.com
upstream mydomain.com {
        ## Can be connected with "mydomaincom_default" network
        # mydomaincom_app_1
        server 172.31.0.4:9000;
        # 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;
        # 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;
        # 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;
}
server {
# If we server_name mydomain.com; pass it through; otherwise, pass along the        listen 80 ;        access_log /var/log/nginx/access.log vhost;
        return 301 https://$host$request_uri;
}
server {
        server_name mydomain.com;
        listen 443 ssl http2 ;
        access_log /var/log/nginx/access.log vhost;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RS        ssl_prefer_server_ciphers on;
        ssl_session_timeout 5m;
        ssl_session_cache shared:SSL:50m;
        ssl_session_tickets off;
        ssl_certificate /etc/nginx/certs/mydomain.com.crt;
        ssl_certificate_key /etc/nginx/certs/mydomain.com.key;
        ssl_dhparam /etc/nginx/certs/mydomain.com.dhparam.pem;
        ssl_stapling on;
        ssl_stapling_verify on;
        ssl_trusted_certificate /etc/nginx/certs/mydomain.com.chain.pem;
        add_header Strict-Transport-Security "max-age=31536000" always;
        include /etc/nginx/vhost.d/default;
# If we location / {                proxy_pass http://mydomain.com;        }
}

and this is the inspect informations for my nginx service :

{
    "AppArmorProfile": "",
    "Args": [
        "-g",
        "daemon off;"
    ],
    "Config": {
        "ArgsEscaped": true,
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "nginx",
            "-g",
            "daemon off;"
        ],
        "Domainname": "",
        "Entrypoint": null,
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "NGINX_VERSION=1.15.3"
        ],
        "ExposedPorts": {
            "80/tcp": {}
        },
        "Hostname": "5b0de1f4b6c7",
        "Image": "mydomaincom_front-nginx",
        "Labels": {
            "com.docker.compose.config-hash": "4d2fb8f1f428c71b8aee9a52ddf735c716c38b7836ff454612db4645f58ed062",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "mydomaincom",
            "com.docker.compose.service": "front-nginx",
            "com.docker.compose.version": "1.21.2",
            "maintainer": "NGINX Docker Maintainers <docker-maint@nginx.com>"
        },
        "OnBuild": null,
        "OpenStdin": false,
        "StdinOnce": false,
        "StopSignal": "SIGTERM",
        "Tty": false,
        "User": "",
        "Volumes": {
            "/etc/nginx/conf.d": {},
            "/srv/app/public": {}
        },
        "WorkingDir": ""
    },
    "Created": "2018-08-31T13:24:16.518002272Z",
    "Driver": "overlay2",
    "ExecIDs": null,
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/9148ca35cb2760e56f42565397d80abfcd769c794d6faef07f59440c9ac1d35c-init/diff:/var/lib/docker/overlay2/bffb75bdd3e2fe0f742bfef8fd6fc7c397cb8c1aa47a5bc1746fb64b4acefc8e/diff:/var/lib/docker/overlay2/74f4080a99f00e8511b3aaa8653ba80151f164d0b768e145d8629f6a5bb7e03f/diff:/var/lib/docker/overlay2/f8f3208d2793570214d0c655a040069950f299f4d5b17b941fc2818cf3a785b6/diff:/var/lib/docker/overlay2/12ae3135102393bd86e2605309b21f000f6cc515f6aa49afdfb9b4baae181c9c/diff:/var/lib/docker/overlay2/cbdb1388f7296985cbd0770fdf37d043a64593b98177da2c2f6fb17d66fb9d8c/diff:/var/lib/docker/overlay2/cca803fe45577abc2a332c7cf18d7988e863e44256b0cd80ea8ad91362aa946c/diff",
            "MergedDir": "/var/lib/docker/overlay2/9148ca35cb2760e56f42565397d80abfcd769c794d6faef07f59440c9ac1d35c/merged",
            "UpperDir": "/var/lib/docker/overlay2/9148ca35cb2760e56f42565397d80abfcd769c794d6faef07f59440c9ac1d35c/diff",
            "WorkDir": "/var/lib/docker/overlay2/9148ca35cb2760e56f42565397d80abfcd769c794d6faef07f59440c9ac1d35c/work"
        },
        "Name": "overlay2"
    },
    "HostConfig": {
        "AutoRemove": false,
        "Binds": [
            "/home/debian/mydomain.com/docker/nginx/conf.d:/etc/nginx/conf.d:ro",
            "/home/debian/mydomain.com/public:/srv/app/public:ro"
        ],
        "BlkioDeviceReadBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceWriteIOps": null,
        "BlkioWeight": 0,
        "BlkioWeightDevice": null,
        "CapAdd": null,
        "CapDrop": null,
        "Cgroup": "",
        "CgroupParent": "",
        "ConsoleSize": [
            0,
            0
        ],
        "ContainerIDFile": "",
        "CpuCount": 0,
        "CpuPercent": 0,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpuShares": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "DeviceCgroupRules": null,
        "Devices": null,
        "DiskQuota": 0,
        "Dns": null,
        "DnsOptions": null,
        "DnsSearch": null,
        "ExtraHosts": null,
        "GroupAdd": null,
        "IOMaximumBandwidth": 0,
        "IOMaximumIOps": 0,
        "IpcMode": "shareable",
        "Isolation": "",
        "KernelMemory": 0,
        "Links": null,
        "LogConfig": {
            "Config": {},
            "Type": "json-file"
        },
        "MaskedPaths": [
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware"
        ],
        "Memory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "NanoCpus": 0,
        "NetworkMode": "mydomaincom_default",
        "OomKillDisable": false,
        "OomScoreAdj": 0,
        "PidMode": "",
        "PidsLimit": 0,
        "PortBindings": {},
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyPaths": [
            "/proc/asound",
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
        ],
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": ""
        },
        "Runtime": "runc",
        "SecurityOpt": null,
        "ShmSize": 67108864,
        "UTSMode": "",
        "Ulimits": null,
        "UsernsMode": "",
        "VolumeDriver": "",
        "VolumesFrom": []
    },
    "HostnamePath": "/var/lib/docker/containers/5b0de1f4b6c72d46aed371d06889c5a55cae273ceca373acae41b3c68f44e81d/hostname",
    "HostsPath": "/var/lib/docker/containers/5b0de1f4b6c72d46aed371d06889c5a55cae273ceca373acae41b3c68f44e81d/hosts",
    "Id": "5b0de1f4b6c72d46aed371d06889c5a55cae273ceca373acae41b3c68f44e81d",
    "Image": "sha256:7873625ee3b11afa343ab99e10f621775c921daf97dac4108676e79278060847",
    "LogPath": "/var/lib/docker/containers/5b0de1f4b6c72d46aed371d06889c5a55cae273ceca373acae41b3c68f44e81d/5b0de1f4b6c72d46aed371d06889c5a55cae273ceca373acae41b3c68f44e81d-json.log",
    "MountLabel": "",
    "Mounts": [
        {
            "Destination": "/etc/nginx/conf.d",
            "Mode": "ro",
            "Propagation": "rprivate",
            "RW": false,
            "Source": "/home/debian/mydomain.com/docker/nginx/conf.d",
            "Type": "bind"
        },
        {
            "Destination": "/srv/app/public",
            "Mode": "ro",
            "Propagation": "rprivate",
            "RW": false,
            "Source": "/home/debian/mydomain.com/public",
            "Type": "bind"
        }
    ],
    "Name": "/mydomaincom_front-nginx_1",
    "NetworkSettings": {
        "Bridge": "",
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "HairpinMode": false,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "MacAddress": "",
        "Networks": {
            "mydomaincom_default": {
                "Aliases": [
                    "5b0de1f4b6c7",
                    "front-nginx"
                ],
                "DriverOpts": null,
                "EndpointID": "02a872a6b712c8421bb9db26124bb918fead6918077bcfd8c374f0ec2a75ce1f",
                "Gateway": "172.31.0.1",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "IPAMConfig": null,
                "IPAddress": "172.31.0.3",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "Links": null,
                "MacAddress": "02:42:ac:1f:00:03",
                "NetworkID": "9eb424f949a566bc30727d5ed6af2e31098ef67735a39625d7165723f6421bc2"
            }
        },
        "Ports": {
            "80/tcp": null
        },
        "SandboxID": "7e2e7d5611d974e2c49df71b936fb7671e6e34f833df3912a86b11d48b0cbc69",
        "SandboxKey": "/var/run/docker/netns/7e2e7d5611d9",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null
    },
    "Path": "nginx",
    "Platform": "linux",
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/5b0de1f4b6c72d46aed371d06889c5a55cae273ceca373acae41b3c68f44e81d/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 0,
        "FinishedAt": "0001-01-01T00:00:00Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 9508,
        "Restarting": false,
        "Running": true,
        "StartedAt": "2018-08-31T13:24:17.274554351Z",
        "Status": "running"
    }
}

Can you help me to fix this problem ?

Thanks,

Nicolas

@buchdag buchdag closed this as completed May 16, 2024
@buchdag
Copy link
Member

buchdag commented May 16, 2024

This repo should no longer handle issues or discussions related to nginx-proxy / the nginx-proxy template, unless there is something we need to change / fix in docker-gen in order to allow a change / fix in nginx-proxy.

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

2 participants