我需要一个nginx-config文件来运行pimcore。我试过用粉刺医生做的。
这里没有成功..。
Got:
未能重新启动xxxxxx: log=容器失败: err=container /ddev-xxxxxx web不健康。
我在. .ddev/nginx/server.conf中添加了一个配置文件。ddev的版本是v1.10.2,pimcore的版本是最新的pimcore 5。
upstream php-pimcore5 {
server unix:/var/run/php-fpm.sock;
}我想用nginx服务器来更快地使用pimcore.
发布于 2019-11-11 04:37:24
我使用了这个. .ddev/nginx-site.conf (基于https://pimcore.com/docs/5.x/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/Nginx_Configuration.html中的配置),它似乎工作正常。
顺便说一句,我以前从来没有用过粉刺,但我能
ddev config --project-type=phpddev composer create pimcore/demoddev config --docroot=webddev restartddev ssh和export PIMCORE_INSTALL_MYSQL_HOST_SOCKET=db:3306; vendor/bin/pimcore-install它就在那儿。
这里是. .ddev/nginx-site.conf:
# mime types are covered in nginx.conf by:
# http {
# include mime.types;
# }
map $http_x_forwarded_proto $fcgi_https {
default off;
https on;
}
server {
listen 80;
server_name _;
root $WEBSERVER_DOCROOT;
index index.php;
access_log /var/log/access.log;
error_log /var/log/error.log error;
# Pimcore Head-Link Cache-Busting
rewrite ^/cache-buster-(?:\d+)/(.*) /$1 last;
# Stay secure
#
# a) don't allow PHP in folders allowing file uploads
location ~* /var/assets/.*\.php(/|$) {
return 404;
}
# b) Prevent clients from accessing hidden files (starting with a dot)
# Access to `/.well-known/` is allowed.
# https://www.mnot.net/blog/2010/04/07/well-known
# https://tools.ietf.org/html/rfc5785
location ~* /\.(?!well-known/) {
deny all;
log_not_found off;
access_log off;
}
# c) Prevent clients from accessing to backup/config/source files
location ~* (?:\.(?:bak|conf(ig)?|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ {
deny all;
}
# Some Admin Modules need this:
# Database Admin, Server Info
location ~* ^/admin/(adminer|external) {
rewrite .* /app.php$is_args$args last;
}
# Thumbnails
location ~* .*/(image|video)-thumb__\d+__.* {
try_files /var/tmp/$1-thumbnails$uri /app.php;
expires 2w;
access_log off;
add_header Cache-Control "public";
}
# Assets
# Still use a whitelist approach to prevent each and every missing asset to go through the PHP Engine.
location ~* ^(?!/admin/asset/webdav/)(.+?)\.((?:css|js)(?:\.map)?|jpe?g|gif|png|svgz?|eps|exe|gz|zip|mp\d|ogg|ogv|webm|pdf|docx?|xlsx?|pptx?)$ {
try_files /var/assets$uri $uri =404;
expires 2w;
access_log off;
log_not_found off;
add_header Cache-Control "public";
}
location / {
error_page 404 /meta/404;
add_header "X-UA-Compatible" "IE=edge";
try_files $uri /app.php$is_args$args;
}
# Use this location when the installer has to be run
# location ~ /(app|install)\.php(/|$) {
#
# Use this after initial install is done:
location ~ ^/app\.php(/|$) {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_intercept_errors off;
# fastcgi_read_timeout should match max_execution_time in php.ini
fastcgi_read_timeout 10m;
fastcgi_param SERVER_NAME $host;
fastcgi_param HTTPS $fcgi_https;
}
include /etc/nginx/monitoring.conf;
}https://stackoverflow.com/questions/58763897
复制相似问题