Welcome to Panzi's site.
How to build a blog
First of all, you need to have a domain name, you can get one on the website like namesilo. Then you have to own a server for making the website. I use a Raspberry PI serving as a server, so let's make a file on the server.
mkdir -p /opt/mkdocs
Use docker command
docker pull squidfunk/mkdocs-material
docker run -it --rm -v /opt/mkdocs:/docs squidfunk/mkdocs-material new cc-docs
docker run -it
--name mkdocs
--restart=always -v /opt/mkdocs:/docs -p 10025:8000
--workdir /docs/cc-docs squidfunk/mkdocs-material serve -a 0.0.0.0:8000
Docker install Nginx
Pull the lastest image
docker run --name my-nginx -p 80:80 -d nginx
Get inside the container
docker exec -it my-nginx /bin/bash
Modify the nginx.conf file
docker cp ./nginx.conf my-nginx:/etc/nginx/nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/error.log warn;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types {
text/html html;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpg;
application/javascript js;
application/json json;
application/ld+json ld+json;
application/x-font-ttf ttf;
font/opentype otf;
image/svg+xml svg;
image/x-icon ico;
application/x-web-app-manifest+json webmanifest;
application/x-font-woff woff;
application/x-font-woff2 woff2;
}
server {
listen 80;
server_name www.panzi.site;
location / {
proxy_pass (my local address);
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
}
}
}
Restart nginx
docker exec my-nginx nginx -s reload
Set up Port Forwarding
You must open an external port such as 80 and an internal port such as 192.168.1.127:10025, making the contents of your internal port accessible via the Internet.