-
使用以下镜像运行旧项目,这个镜像有多个版本的php,大部分模块都安装了。
- 使用本机nginx代理docker中运行的低版本php+apache项目
Apache运行到8081端口;
nginx代理配置:
server{
listen 80;
server_name www.xxx.cn;
root /var/etc/html;
index index.php index.html;
location / {
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host www.xxx.cn;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_redirect / /;
}
location ~* \.php$ {
proxy_pass http://127.0.0.1:8081;
proxy_set_header Host www.xxx.cn;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
}
}