Replace Unit configuration with Nginx + PHP-FPM setup in Docker
- Remove outdated Unit-based Docker configuration and scripts. - Introduce Nginx + PHP-FPM stack with environment-based configurations. - Add custom Nginx setup for frontend-backend routing. - Update Dockerfiles, Docker Compose, and related scripts for new architecture.
This commit is contained in:
15 files changed
+293
-375
No files matched your search
@@ -0,0 +1,44 @@
|
||||
map $FRONTEND_PORT $host_with_port {
|
||||
"" $host;
|
||||
default "$host:$FRONTEND_PORT";
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE};
|
||||
|
||||
disable_symlinks if_not_owner from=/usr/share/nginx/html;
|
||||
|
||||
index index.php index.html;
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
${GZIP_BLOCK}
|
||||
${REAL_IP_BLOCK}
|
||||
|
||||
location / {
|
||||
location / {
|
||||
try_files $uri @fallback;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
return 404;
|
||||
}
|
||||
location ~ /\. {
|
||||
return 404;
|
||||
}
|
||||
location ~ /\.(ht|svn|git) {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
location @fallback {
|
||||
fastcgi_pass ${BACKEND_HOST}:${BACKEND_PORT};
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param REDIRECT_STATUS 200;
|
||||
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;
|
||||
fastcgi_param SCRIPT_NAME /index.php;
|
||||
fastcgi_param HTTP_HOST $host_with_port;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user