Answer the question
In order to leave comments, you need to log in
How to open port 80 and 443 on Oracle server?
A container is running on the virtual machine.
Dockerfile
FROM nginx:latest
COPY my.conf /etc/nginx/conf.d/
EXPOSE 80
EXPOSE 443
server {
listen 80;
server_name localhost;
location / {
access_log off;
default_type text/plain;
add_header Content-Type text/plain;
return 200 "localhost alive";
}
}
server {
listen 80;
server_name test.com;
location / {
access_log off;
default_type text/plain;
add_header Content-Type text/plain;
return 200 "test.com alive";
}
}
server {
listen 80;
server_name site.com;
location / {
access_log off;
default_type text/plain;
add_header Content-Type text/plain;
return 200 "site.com alive";
}
}
sudo docker run --name $DOCKER_CONTAINER_NAME -d -p $PORT_HOST:$PORT_TCP $DOCKER_IMAGE_LATEST
curl http://localhost
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
Answer the question
In order to leave comments, you need to log in
In the control panel in the virtual network settings, you need to add an allowing rule.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question