まず、クエリのデフォルトの設定ファイル
nginx.conf設定
ユーザーnginxの。 1 worker_processes; error_logに/var/log/nginx/error.log警告します。 pidは/var/run/nginx.pid。 イベント{ worker_connections 1024。 } HTTP { /etc/nginx/mime.typesを含みます。 default_type application / octet-streamと; LOG_FORMATメイン'REMOTE_ADDR $ - $ REMOTE_USER [$ time_local] "$依頼"' '$ステータスの$ body_bytes_sent "$ HTTP_REFERER"' ' "$ HTTP_USER_AGENT" "$ HTTP_X_FORWARDED_FOR"'; /var/log/nginx/access.logメインのaccess_log。 sendfile; 上#tcp_nopush; keepalive_timeout 65; 上#gzip; /etc/nginx/conf.d/*.conf類; }
default.confプロフィール
サーバー{ 80聞きます。 サーバー名はlocalhost。 #charset KOI8-R。 #access_log /var/log/nginx/host.access.logメイン。 位置/ { ルートを/ usr / share / nginxの/ HTML。 index.htmをindex.htmlをインデックス。 } #error_page 404 /404.html。 #静的ページ/50x.htmlにリダイレクトサーバーエラーページ #の error_page 500 502 503 504 /50x.html。 位置= /50x.html { ルートを/ usr / share / nginxの/ HTML。 } #プロキシ127.0.0.1:80上のApacheのリスニングにPHPスクリプト # #location〜\ .phpの$ { #proxy_pass http://127.0.0.1。 #} #127.0.0.1:9000でのFastCGIサーバのリスニングにPHPスクリプトを渡す # #location〜\ .phpの$ { #ルートのhtml; #fastcgi_pass 127.0.0.1:9000。 #fastcgi_index index.phpを。 #fastcgi_paramのSCRIPT_FILENAME /スクリプト$ fastcgi_script_name。 #fastcgi_paramsが含まれます。 #} #は、Apacheのドキュメントルートの場合は、.htaccessファイルへのアクセスを拒否 #の同意nginxのの1と # #location〜/\.ht { #はすべて拒否します。 #} }
第二に、スタート
ドッキングウィンドウの実行--name mynginx -p 443:443 -p 80:80 -v /ドッキングウィンドウ/ nginxの/データ:を/ usr / share / nginxの/ htmlの-v /docker/nginx/config/nginx.conf:/etc/nginx /nginx.conf -v /docker/nginx/config/conf.d/default.conf:/etc/nginx/conf.d/default.conf -v /ドッキングウィンドウ/ nginxの/ログ:は/ var / log / nginxの-v /ドッキングウィンドウ/ nginxの/ SSL:/ SSL /:RW -d nginxの