nginx の configulation

投稿者: | 2023年4月28日

reverse proxy として動作させる nginx の設定は

/etc/nginx/nginx.conf

にて決めます。

# This file is re-created when Nginx starts.
# Consider using UCI or creating files in /etc/nginx/conf.d/ for configuration.
# Parsing UCI configuration is skipped if uci set nginx.global.uci_enable=false
# For details see: https://openwrt.org/docs/guide-user/services/webserver/nginx

worker_processes auto;

user root;

events {}

http {
        access_log off;
        log_format openwrt
                '$request_method $scheme://$host$request_uri => $status'
                ' (${body_bytes_sent}B in ${request_time}s) <- $http_referer';

        include mime.types;
        default_type application/octet-stream;
        sendfile on;

        client_max_body_size 128M;
        large_client_header_buffers 2 1k;

        gzip on;
        gzip_vary on;
        gzip_proxied any;

  ##
  # Virtual Host Configs
  ##

        include conf.d/*.conf;
}

としました。最後の行にあるように、/etc/nginx/conf.d/ ディレクトリに mysite.com.conf を書いておけば、https://mysite.comへアクセスしたときの動作を決めることができます。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です