

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# nginx 属性
<a name="attributes-recipes-nginx"></a>

**重要**  
この AWS OpsWorks Stacks サービスは 2024 年 5 月 26 日にサポート終了となり、新規および既存のお客様の両方で無効になっています。できるだけ早くワークロードを他のソリューションに移行することを強くお勧めします。移行についてご質問がある場合は、[AWS re:Post](https://repost.aws/) または[AWS プレミアムサポート](https://aws.amazon.com/support)を通じて AWS サポート チームにお問い合わせください。

**注記**  
これらの属性は Linux スタックにのみ使用できます。

[`nginx` 属性](https://github.com/aws/opsworks-cookbooks/blob/release-chef-11.10/nginx/attributes/nginx.rb)は [Nginx](http://wiki.nginx.org/Main) 設定を指定します。詳細については、「[ディレクティブインデックス](http://wiki.nginx.org/DirectiveIndex)」を参照してください。組み込み属性を上書きしてカスタム値を指定する方法の詳細については、「[属性の上書き](workingcookbook-attributes.md)」を参照してください。


****  

|  |  |  | 
| --- |--- |--- |
| [バイナリ ](#attributes-recipes-nginx-binary) | [dir ](#attributes-recipes-nginx-dir) | [gzip ](#attributes-recipes-nginx-gzip) | 
| [gzip\$1comp\$1level ](#attributes-recipes-nginx-gzip-comp) | [gzip\$1disable ](#attributes-recipes-nginx-gzip-disable) | [gzip\$1http\$1version ](#attributes-recipes-nginx-gzip-http) | 
| [gzip\$1proxied ](#attributes-recipes-nginx-gzip-proxied) | [gzip\$1static ](#attributes-recipes-nginx-gzip-static) | [gzip\$1types ](#attributes-recipes-nginx-gzip-types) | 
| [gzip\$1vary ](#attributes-recipes-nginx-gzip-vary) | [keepalive ](#attributes-recipes-nginx-keepalive) | [keepalive\$1timeout ](#attributes-recipes-nginx-keepalive-timeout) | 
| [log\$1dir ](#attributes-recipes-nginx-log) | [ユーザー ](#attributes-recipes-nginx-user) | [server\$1names\$1hash\$1bucket\$1size](#attributes-recipes-nginx-worker-hash) | 
| [worker\$1processes ](#attributes-recipes-nginx-worker-processes) | [worker\$1connections ](#attributes-recipes-nginx-worker-connections) |  | 

**バイナリ **  <a name="attributes-recipes-nginx-binary"></a>
Nginx バイナリの場所 (文字列)。デフォルト値は `'/usr/sbin/nginx'` です。  

```
node[:nginx][:binary]
```

**dir **  <a name="attributes-recipes-nginx-dir"></a>
設定ファイルなどのファイルの場所 (文字列)。デフォルト値は `'/etc/nginx'` です。  

```
node[:nginx][:dir]
```

**gzip **  <a name="attributes-recipes-nginx-gzip"></a>
gzip 圧縮が有効であるかどうか (文字列)。指定できる値は `'on'` および `'off'` です。デフォルト値は `'on'` です。  
圧縮によってセキュリティリスクが生じる可能性があります。圧縮を完全に無効にするには、この属性を次のように設定します。  

```
node[:nginx][:gzip] = 'off'
```

```
node[:nginx][:gzip]
```

**gzip\$1comp\$1level **  <a name="attributes-recipes-nginx-gzip-comp"></a>
圧縮レベルは、1～9 の値域を定めることができ、1 は最小圧縮 (文字列)に対応します。デフォルト値は `'2'` です。  

```
node[:nginx][:gzip_comp_level]
```

**gzip\$1disable **  <a name="attributes-recipes-nginx-gzip-disable"></a>
指定したユーザーエージェントに対して gzip 圧縮を無効にします (文字列)。値は正規表現で、デフォルト値は `'MSIE [1-6].(?!.*SV1)'` です。  

```
node[:nginx][:gzip_disable]
```

**gzip\$1http\$1version **  <a name="attributes-recipes-nginx-gzip-http"></a>
指定した HTTP バージョンに対して gzip 圧縮を有効にします (文字列)。デフォルト値は `'1.0'` です。  

```
node[:nginx][:gzip_http_version]
```

**gzip\$1proxied **  <a name="attributes-recipes-nginx-gzip-proxied"></a>
プロキシリクエストへのレスポンスを圧縮するかどうか、およびその方法。次のいずれかの値になります (文字列)。  
+ `'off'`: プロキシされたリクエストを圧縮しない
+ `'expired'`: 有効期限切れヘッダーでキャッシングが妨げられる場合は圧縮する
+ `'no-cache'`: キャッシュ制御ヘッダーが「no-cache」に設定されている場合は圧縮する
+ `'no-store'`: キャッシュ制御ヘッダーが「no-store」に設定されている場合は圧縮する
+ `'private'`: のキャッシュ制御ヘッダーが「private」に設定されている場合は圧縮する
+ `'no_last_modified'`: [Last-Modified] が設定されていない場合は圧縮する
+ `'no_etag'`: リクエストに ETag ヘッダーがない場合は圧縮する
+ `'auth'`: リクエストに認可ヘッダーが含まれる場合は圧縮する
+ `'any'`: すべてのプロキシされたリクエストを圧縮する 
デフォルト値は `'any'` です。  

```
node[:nginx][:gzip_proxied]
```

**gzip\$1static **  <a name="attributes-recipes-nginx-gzip-static"></a>
gzip 静的モジュールが有効であるかどうか (文字列)。指定できる値は `'on'` および `'off'` です。デフォルト値は `'on'` です。  

```
node[:nginx][:gzip_static]
```

**gzip\$1types **  <a name="attributes-recipes-nginx-gzip-types"></a>
圧縮する MIME タイプのリスト (文字列のリスト)。デフォルト値は `['text/plain', 'text/html', 'text/css', 'application/x-javascript', 'text/xml', 'application/xml', 'application/xml+rss', 'text/javascript']` です。  

```
node[:nginx][:gzip_types]
```

**gzip\$1vary **  <a name="attributes-recipes-nginx-gzip-vary"></a>
`Vary:Accept-Encoding ` レスポンスヘッダーを有効にするかどうか (文字列)。指定できる値は `'on'` および `'off'` です。デフォルト値は `'on'` です。  

```
node[:nginx][:gzip_vary]
```

**keepalive **  <a name="attributes-recipes-nginx-keepalive"></a>
キープアライブ接続を有効にするかどうか (文字列)。指定できる値は `'on'` および `'off'` です。デフォルト値は `'on'` です。  

```
node[:nginx][:keepalive]
```

**keepalive\$1timeout **  <a name="attributes-recipes-nginx-keepalive-timeout"></a>
キープアライブ接続を開いたままにする最大時間 (秒) (数値)。デフォルト値は `65` です。  

```
node[:nginx][:keepalive_timeout]
```

**log\$1dir **  <a name="attributes-recipes-nginx-log"></a>
ログファイルの場所 (文字列)。デフォルト値は `'/var/log/nginx'` です。  

```
node[:nginx][:log_dir]
```

**ユーザー **  <a name="attributes-recipes-nginx-user"></a>
ユーザー (文字列)。デフォルト値は次のとおりです。  
+ Amazon Linux および RHEL: `'www-data'`
+ Ubuntu: `'nginx'`

```
node[:nginx][:user]
```

**server\$1names\$1hash\$1bucket\$1size**  <a name="attributes-recipes-nginx-worker-hash"></a>
`32`、`64`、または `128` に設定できるサーバー名のハッシュテーブルのバケットサイズ (数値)。デフォルト値は `64` です。  

```
node[:nginx][:server_names_hash_bucket_size]
```

**worker\$1processes **  <a name="attributes-recipes-nginx-worker-processes"></a>
ワーカープロセスの数 (数値)。デフォルト値は `10` です。  

```
node[:nginx][:worker_processes]
```

**worker\$1connections **  <a name="attributes-recipes-nginx-worker-connections"></a>
ワーカー接続の最大数 (数値)。デフォルト値は `1024` です。クライアントの最大数は `worker_processes * worker_connections` に設定されます。  

```
node[:nginx][:worker_connections]
```