diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..0272b65 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 80; + server_name localhost; + + location / { + root /antora/public; + index index.html index.htm; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file diff --git a/preview.sh b/preview.sh index acab783..d70b6e9 100755 --- a/preview.sh +++ b/preview.sh @@ -5,7 +5,7 @@ if [ "$(uname)" == "Darwin" ]; then # Let's assume that the user has the Docker CE installed # which doesn't require a root password. echo "The preview will be available at http://localhost:8080/" - docker run --rm -v $(pwd)/public:/usr/share/nginx/html:ro -p 8080:80 nginx + docker run --rm -v $(pwd):/antora:ro -p 8080:80 nginx elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then # Running on Linux. @@ -14,5 +14,5 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then echo "" echo "This build script is using Docker to run the build in an isolated environment. You might be asked for a root password in order to start it." echo "The preview will be available at http://localhost:8080/" - sudo docker run --rm -v $(pwd)/public:/usr/share/nginx/html:ro -p 8080:80 nginx + sudo docker run --rm -v $(pwd):/antora:ro,z -v $(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf:ro,z -p 8080:80 nginx fi