当我打开我的应用程序时,我试图在 Heroku 中运行容器,它显示我的 PHP 的原始文件
FROM ubuntu:latest
ENV PORT=80
[....]
COPY default.conf.template /etc/nginx/conf.d/default.conf.template
COPY nginx.conf /etc/nginx/nginx.conf
CMD /bin/bash -c "envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf" && nginx -g 'daemon off;'
default.conf.template
server {
listen $PORT default_server;
root /var/www/myapp;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
}
nginx.conf
worker_processes 4; # Heroku dynos have at least four cores.
error_log stderr;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
access_log /dev/stdout;
server_tokens off; # Hide nginx version in Server header & page footers
include /etc/nginx/conf.d/*.conf;
}
先感谢您