docker 에 nginx 를 설치 하고 여러 도 메 인 이름 을 설정 합 니 다.
1324 단어 수필
docker search nginx
2. nginx 미 러 다운로드
docker pull nginx:5.7
3. 용기 만 들 기 및 시작
docker run -p 80:80 --name myNgin -v /nginx/nginx.conf:/etc/nginx/nginxconf -d nginx
nginx , /etc/nginx/nginx.conf , /nginx/nginx.conf
4. / nginx / nginx. conf 에 들 어가 설정 수정
http {
server {
listen 80;
server_name yxiumei.com;
access_log off;
location / {
proxy_pass a.com:9000;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
server {
listen 80;
server_name abc.com;
access_log off;
location / {
proxy_pass http://abc.com:8000;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
5. 프로필 을 수정 하려 면 etc / nginx 디 렉 터 리 에 들 어가 서 다시 시작 해 야 합 니 다.
nginx -s reload
개인 홈 페이지