UJP - nginx.conf

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ MacBook Pro の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - nginx.conf

nginx.conf

カテゴリ : 
Apple » MacBook Pro » 2011 13inch
ブロガー : 
ujpblog 2019/10/15 1:27
 以前やったSplunkのフロントにnginxを置いてリバースプロキシとする設定を,前回メモが足りなかったので,全量を載せておく.
gaia:nginx ujpadmin$ cat nginx.conf🆑
worker_processes  1;
error_log  /Users/ujpadmin/Documents/nginx/error/error.log;
error_log  /Users/ujpadmin/Documents/nginx/error/error.log  notice;
error_log  /Users/ujpadmin/Documents/nginx/error/error.log  info;
pid        /Users/ujpadmin/Documents/nginx/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /Users/ujpadmin/Documents/nginx/access/access.log  main;

    sendfile        on;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  192.168.20.26;

        access_log  /Users/ujpadmin/Documents/nginx/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

	location /splunk/ {
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_pass   http://192.168.20.26:8000;
		proxy_set_header  X-Forwarded-For     $proxy_add_x_forwarded_for;
		proxy_set_header  X-Forwarded-Host    $host;
		proxy_set_header  Host                $host;
		proxy_set_header  X-Forwarded-Server  $hostname;
        }
    }
}
gaia:nginx ujpadmin$
 ポート80番でnginxがHTTPを受け,同じサーバの8000番ポートで稼働しているSplunkへの接続.

トラックバック


広告スペース
Google