D
D
Dmitry Bychkov2020-10-23 23:47:10
PHP
Dmitry Bychkov, 2020-10-23 23:47:10

Docker how to attach a domain?

The essence such is the server on which there is Nginx and php. There is a project that I can't touch.

I want to run another project in a separate container on this image ipburger/php7.1-ioncube
https://hub.docker.com/r/ipburger/php7.1-ioncube
How can I attach a domain to it?
I run it like this:
docker run -v /var/www/site.shop/public_html/:/app -p 8150:80 -p 8153:443 -e WEB_ALIAS_DOMAIN=site.shop ipburger/php7.1-ioncube
IP address: the port comes in and everything works 100%
Here is the ngix config

server {
    listen 80;
    server_name site.shop;

    access_log /var/www/site.shop/log/access.log;
    error_log /var/www/site.shop/log/error.log;

    location / {
        proxy_pass http://0.0.0.0:8150;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_connect_timeout 120;
        proxy_send_timeout 120;
        proxy_read_timeout 180;
    }
}

And still it doesn't work. He googled everything he could.

I tried accessing localhost, gateway ip, directly and nothing works

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Bychkov, 2020-11-02
@bychkov_64

Doper what you need to raise nginx in the container. And on the local in nginx, make proxy_pass on localhost:3000.

K
ky0, 2020-10-24
@ky0

proxy_pass 0.0.0.0:8150;
Where are you planning to go, tell me?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question