Add an example nginx conf

master
Jiajie Chen 6 years ago
parent 315299114e
commit 0c30009938

@ -78,9 +78,11 @@ nginx:
ifneq ($(arch), riscv32)
ifneq ($(shell uname), Darwin)
@echo Building nginx
mkdir -p $(out_dir)
mkdir -p $(out_dir)/usr/local/nginx/conf
mkdir -p $(out_dir)/usr/local/nginx/logs
@cd nginx && make arch=$(arch) all
@cp nginx/build/$(arch)/nginx $(out_dir)/nginx
@cp nginx/build/$(arch)/nginx $(out_dir)
@cp nginx/nginx.conf $(out_dir)/usr/local/nginx/conf
endif
endif
@ -102,6 +104,7 @@ $(alpine):
alpine: $(alpine)
ifeq ($(arch), $(filter $(arch), x86_64 aarch64))
@mkdir -p $(out_dir)
@echo "nameserver 101.6.6.6" > $(out_dir)/etc/resolv.conf
@cd $(out_dir) && tar xvf ../../$(alpine)
endif

@ -16,6 +16,7 @@ $(nginx_dir): $(nginx_tarball_path)
cd $(build_dir) && tar xvf ../../$(nginx_tarball_path)
$(nginx_dir)/objs/nginx: $(nginx_dir)
# cross compile, do not run
sed -i 's/ngx_feature_run=yes/ngx_feature_run=no/' $(nginx_dir)/auto/cc/name
sed -i 's/ngx_test="$$CC /ngx_test="gcc /' $(nginx_dir)/auto/types/sizeof
cd $(nginx_dir) && ./configure --with-cc=$(cc) --with-cc-opt=-static --with-ld-opt=-static --without-pcre --without-http_rewrite_module --without-http_gzip_module --with-poll_module --without-http_upstream_zone_module

@ -0,0 +1,17 @@
master_process off;
events {
worker_connections 1;
use poll;
}
http {
server {
server_name _;
listen 80;
location / {
root /;
autoindex on;
}
}
}

@ -16,11 +16,11 @@ undefine ARCH
$(redis_tarball_path):
wget http://download.redis.io/releases/$(redis_tarball) -O $(redis_tarball_path)
$(redis_dir): $(redis_tarball_path)
$(redis_dir)/src/config.h: $(redis_tarball_path)
mkdir -p $(build_dir)
cd $(build_dir) && tar xvf ../../$(redis_tarball_path)
$(redis_dir)/src/redis-server: $(redis_dir)
$(redis_dir)/src/redis-server: $(redis_dir)/src/config.h
# we do not support epoll at the time
sed -i 's/#define HAVE_EPOLL 1//' $(redis_dir)/src/config.h
# our accept does not have backlog
@ -34,7 +34,7 @@ $(bin_server): $(bin_server_unstripped)
cp $(bin_server_unstripped) $(bin_server)
$(strip) $(bin_server)
$(bin_cli_unstripped): $(redis_dir)/src/redis-cli
$(bin_cli_unstripped): $(redis_dir)/src/redis-server
cp $(redis_dir)/src/redis-cli $(bin_cli_unstripped)
$(bin_cli): $(bin_cli_unstripped)

Loading…
Cancel
Save