LoginSignup
0
1

More than 5 years have passed since last update.

Nginxの豆知識🌿

Posted at
1 / 12

proxy

ブラウザ -> プロキシ -> 🌏 -> サーバー


reverse proxy

ブラウザ -> 🌏 -> プロキシ -> サーバー


Nginx

NGINX is a free, open-source, high-performance HTTP server and reverse proxy


Nginxのプロキシ設定についてお話します


基本ルール

セクション {
  ディレクティブ パラメータ;
}

例えばこんな感じ

server {
  listen 80;
  server_name hogehoge.com;
  return 301 https://hogehoge.com$request_uri;
}

今日の本題

これ

upstream unicorn {
  server hogehoge option;
}

hogehogeの部分で呼べるもの

  • 上位サーバーのアドレス(ドメイン名、IPアドレスおよびTCPポート、UNIXドメインソケットへのパス)
  • オプションのパラメータ

  • ドメイン名、IPアドレスおよびTCPポート -> たぶん🙆
  • UNIXドメインソケットへのパス -> ...🙅

UNIXドメインソケット

プロセス間でデータを交換するためのルール

nginx.conf内の
unix:/var/www/hogehoge/current/tmp/sockets/unicorn.sock

config/unicorn.sock内の
listen "/var/www/hogehoge/current/tmp/sockets/unicorn.sock

TCP/IPのループバックより早い

TCP/IP接続の際のオーバーヘッドがないかららしい...参考


設定を確認してみてね!

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