Public Access
nginx слушает 80 внутри контейнера, снаружи публикуется HTTP_PORT. Эгея с E2_SYNTH_URLS собирает абсолютные URL из FastCGI-параметров, поэтому HTTP_HOST и SERVER_PORT берутся из NGINX_EXTERNAL_PORT (тот же HTTP_PORT). Редиректы nginx делаются относительными. Шаблон монтируется из docker/nginx/, а не из несуществующего ./nginx/. Каталог data монтируется в nginx только для чтения, чтобы location статики отдавал pictures и файлы из user. Сервис nginx собирается из того же Dockerfile (target nginx) и ждёт здоровый php-fpm.
69 lines
1.5 KiB
Plaintext
69 lines
1.5 KiB
Plaintext
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
server_name ${NGINX_SERVER_NAME};
|
|
|
|
keepalive_timeout 70;
|
|
client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE};
|
|
|
|
absolute_redirect off;
|
|
port_in_redirect off;
|
|
|
|
root /var/www/html;
|
|
index index.php index.html;
|
|
|
|
location ~* ^.+\.(jpg|jpeg|gif|css|html|htm|png|js|webp|avif|svg|mp3|ogg|mp4|mov)$ {
|
|
access_log off;
|
|
expires 30d;
|
|
}
|
|
|
|
error_page 404 /errors/404.html;
|
|
|
|
location / {
|
|
log_not_found off;
|
|
rewrite ^(.*)$ /index.php?go=$1 last;
|
|
}
|
|
|
|
location ~ ^/(system|user)/.*\.php$ {
|
|
deny all;
|
|
return 403;
|
|
}
|
|
|
|
location = /user/settings.json {
|
|
deny all;
|
|
return 403;
|
|
}
|
|
|
|
location = /user/settings.psa {
|
|
deny all;
|
|
return 403;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
include fastcgi_params;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
|
fastcgi_param HTTP_HOST $host:${NGINX_EXTERNAL_PORT};
|
|
fastcgi_param SERVER_NAME $host;
|
|
fastcgi_param SERVER_PORT ${NGINX_EXTERNAL_PORT};
|
|
fastcgi_param HTTP_X_FORWARDED_HOST $host;
|
|
fastcgi_param HTTP_X_FORWARDED_PORT ${NGINX_EXTERNAL_PORT};
|
|
fastcgi_param HTTP_X_FORWARDED_PROTO $scheme;
|
|
|
|
fastcgi_param E2_SYNTH_URLS true;
|
|
|
|
fastcgi_pass php:9000;
|
|
fastcgi_index index.php;
|
|
}
|
|
|
|
location ~ /\.ht {
|
|
deny all;
|
|
}
|
|
|
|
location ~ \.psa$ {
|
|
deny all;
|
|
}
|
|
}
|