Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move nginx.conf under www/html/ #21

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,4 @@ EXPOSE 2222/tcp

ENTRYPOINT ["/usr/local/docker-entrypoint.sh"]
# Start PHP-FPM and Nginx servers
CMD /usr/local/php-fpm.sh & nginx -g "daemon off;" -c "/var/www/nginx.conf" & /usr/sbin/sshd -D
CMD /usr/local/php-fpm.sh & nginx -g "daemon off;" -c "/var/www/html/nginx.conf" & /usr/sbin/sshd -D
6 changes: 3 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ fi

#copy nginx config
file_path="/etc/nginx/nginx.conf"
dst_path="/var/www/nginx.conf"
dst_path="/var/www/html/nginx.conf"
if [ -f "$dst_path" ]; then
echo "$dst_path already exist."
else
echo "Creating $dst_path..."
cp "$file_path" "/var/www/"
cp "$file_path" "/var/www/html/"
echo "Nginx file copied successfully."
fi

Expand All @@ -57,7 +57,7 @@ for contentPath in \
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
if [ -d "/var/www/html/wp-admin" ]; then
if [ -d "/var/www/html/wp-admin" ] && [ -f "/var/www/html/wp-config.php" ]; then
echo "Wordpress already there skipping..."
else
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
Expand Down
4 changes: 4 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ http {
location = /xmlrpc.php {
deny all;
}
# Block nginx.conf
location = /nginx.conf {
deny all;
}


}
Expand Down
Loading