🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ #docker安装 版本: php7.2-fpm mysql 5.7 nginx 1.16 mysql容器: docker run -d -v /config/mysql/log:/var/log/mysql -v /config/mysql/conf:/etc/mysql/conf.d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=admin123 --name mysql57 mysql:5.7 php容器: docker run -d -v /project/www/html/laravel5.5/:/usr/share/nginx/html/ -p 9000:9000 --link mysql57:mysql --name php72 php:7.2-fpm nginx容器: docker run -d -p 80:80 -v /project/www/html/laravel5.5:/usr/share/nginx/html/ -v /config/nginx/conf.d:/etc/nginx/conf.d --link php72:phpfpm --name nginx116 nginx:1.16 ~~~ 配置文件 ``` server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { #隐藏入口文件 if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; } root /usr/share/nginx/html/public; index index.html index.htm index.php; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass php72:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/public/$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } ```