391行目: 391行目:
  <syntaxhighlight lang="nginx">
  <syntaxhighlight lang="nginx">
  # nginx.confファイル
  # nginx.confファイル
# NginXのPIDファイルの場所
#pid        /tmp/nginx.pid;
# 使用するCPUのプロセス数
# CPUのコア数より多く設定してもパフォーマンスは上がらない
worker_processes  1;
# エラーログの指定
# ログレベルは低い順にdebug, info, notice, warn, error, crit, alert, emerg
error_log  log/error.log  info;
events {
    worker_connections  1024;
}
   
   
  http {
  http {
     # ...略
     # ...略
    # 設定ファイルの読み込み
    #include /etc/nginx/conf.d/ssl.conf
    #include /etc/nginx/vhost.d/*.conf
   
   
     server {
     server {
404行目: 423行目:
                     # 例1. log/localhost.log;
                     # 例1. log/localhost.log;
                     # 例2. /srv/www/htdoc/log/localhost.log;
                     # 例2. /srv/www/htdoc/log/localhost.log;
        # IPフィルタリング
        # 上にあるルールが優先
        #allow all;
        #deny  all;
        # インデックスファイルが存在しない場合、ファイル一覧を有効化 / 無効化
        autoindex on;
   
   
         location / {
         location / {
461行目: 488行目:
         }
         }
   
   
         # deny access to .htaccess files, if Apache's document root
         # ApacheのドキュメントルートがNginXのドキュメントルートと一致する場合、.htaccessファイルへのアクセスを拒否する
        # concurs with nginx's one
        #
         #location ~ /\.ht {
         #location ~ /\.ht {
         #    deny  all;
         #    deny  all;