특정 Repo 구성을 위한 디렉토리 구성을 위한 설정
user root root;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
server {
listen 8090 backlog=1024;
server_name localhost;
charset utf-8;
auth_basic "internal usage";
auth_basic_user_file /etc/nginx/.htpasswd;
pagespeed on;
pagespeed FileCachePath /root/repo/cache;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /mysql {
root /root/repo;
autoindex on;
}
location /oracle {
root /root/repo;
autoindex on;
}
location /python {
alias /root/python/packages;
autoindex on;
}
location /perl {
alias /root/perl/packages;
autoindex on;
}
location /go {
alias /root/repo/go;
}
location /binary {
alias /root/repo/binary;
}
location = /nginx_status { # allow 설정
stub_status on;
access_log off;
allow 10.10.10.0/24;
allow 10.10.20.0/24;
deny all;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
'오픈소스 > nginx' 카테고리의 다른 글
nginx load balancing (0) | 2018.11.27 |
---|---|
nginx mysql load balancing (0) | 2018.10.05 |
nginx proxy 설정예제 (0) | 2018.05.04 |
nginx openresty (0) | 2018.02.07 |
nginx pagespeed (0) | 2018.02.07 |