Answer the question
In order to leave comments, you need to log in
How to configure /etc/hosts site on docker on VPS?
Good afternoon,
There is docker-compose.yml:
version: '3.7'
services:
nginx:
container_name: nginx
build:
context: ./
dockerfile: docker/containers/nginx/Dockerfile
volumes:
- ./app:/var/www
ports:
- 80:80
- 443:443
...
FROM nginx:1.10
ADD ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
WORKDIR /var/www
server
{
listen 80;
index index.php index.html;
root /var/www/public;
location / {
try_files $uri /index.php?$args;
}
location /docs {
try_files $uri $uri/;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
127.0.0.1 localhost
# {v.p.s.ip} vps41742912.local vps41742912
docker-compose up
Answer the question
In order to leave comments, you need to log in
extra_hosts
Cause of the problem - the image does not contain your /etc/hosts
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question