0
0

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.

CentOS6にnginx 1.18 を入れてリバースプロキシ設定

Last updated at Posted at 2021-01-20

前提

  • 自己署名証明書をすでに作っていること。
  • httpサーバーがすでにあること。
  • httpsサーバーが今は‘ないこと

Download

nginx.png

インストール

# インストール前のテスト
rpm -ivh --test "nginx-1.18.0-2.el6.ngx.x86_64.rpm"

# インストール
rpm -ivh "nginx-1.18.0-2.el6.ngx.x86_64.rpm"

# インストールされたファイル一覧の表示
rpm -qal nginx

設定

  • /etc/nginx/conf.d/default.conf
server {
    listen       443 ssl;
    server_name  server.local;

    # hide nginx version.
    server_tokens off;

    # ssl_verify_client      on;
    ssl_verify_client      off;
    ssl_certificate        /etc/nginx/wildcard_local/wildcard_local.crt;
    ssl_certificate_key    /etc/nginx/wildcard_local/private/wildcard_local.key;
    ssl_client_certificate /etc/nginx/wildcard_local/ca.crt;
    ssl_ciphers            'HIGH:!aNULL:!MD5';
    ssl_protocols          TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;

    proxy_set_header    Host		server.local;
    proxy_set_header    X-Real-IP	$remote_addr;
    proxy_set_header    X-Forwarded-Host	$host;
    proxy_set_header    X-Forwarded-Server	$host;
    proxy_set_header    X-Forwarded-For	$proxy_add_x_forwarded_for;

    location / {
        proxy_pass      http://server.local;
    }

}
# 起動
service nginx start

動作確認

https://server.local にアクセスすると
http://server.local の内容が表示されることを確認。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?