0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/etc/nginx/nginx.conf:101

Last updated at Posted at 2020-01-09

最近の勉強で学んだ事を、ノート代わりにまとめていきます。
主に自分の学習の流れを振り返りで残す形なので色々、省いてます。
Webエンジニアの諸先輩方からアドバイスやご指摘を頂けたらありがたいです!

#nginxを起動した際に起きたエラー


nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/etc/nginx/nginx.conf:101

どうやらsslは推奨されていないみたいで、sslではなくlistenを使用する必要がある様です。
以下の様にlistenでsslを指定してみたらエラーを回避できました!

server {
	#listen 443; 
	listen 443 ssl;
	server_name xxx.xxxx.com;

	#ssl on;  
	index index.html;
	ssl_certificate   /usr/local/nginx/cert/api/xxx.pem;
	ssl_certificate_key  /usr/local/nginx/cert/api/xxx.key;
	ssl_session_timeout 5m;
	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_prefer_server_ciphers on;

	location / {
	proxy_set_header  X-Forwarded-Host $host;
	proxy_set_header  X-Forwarded-Proto $scheme;
	proxy_set_header  X-Real-IP  $remote_addr;
	proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header Host $http_host;
	proxy_redirect off;
	expires off;
	sendfile off;
	proxy_pass http://xxx.xxx.com;
      }
}

#参考記事
Nginx設定のまとめ
Nginxの設定ファイルいじったらプロセスが閉じなくなった
他のプロセスがポートを占有してnginxを再起動できない
nginx コマンド超シンプル早見表
nginxで502 Bad Gatewayになる原因
ginxの初期の設定ファイルを読み解いてみよう
macでもnginxを動かしてみた
nginx配置ssl报错
nginxでSSL通信設定をした際のエラーの対処

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?