From 3761c3a51e9b95ed0b9dab2bb2387f34b57742be Mon Sep 17 00:00:00 2001 From: ruowen Date: Sat, 2 Jun 2018 08:37:56 +0800 Subject: [PATCH] refractor tengine to raw 80 Change-Id: Ifc40418de919aafae7ca7ae78d71e35c2398fe85 --- tengine/nginx/Dockerfile | 8 +------- tengine/nginx/nginx.conf | 40 +++++----------------------------------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/tengine/nginx/Dockerfile b/tengine/nginx/Dockerfile index 8156a9a..c7e0eeb 100644 --- a/tengine/nginx/Dockerfile +++ b/tengine/nginx/Dockerfile @@ -21,19 +21,13 @@ COPY sources.list /etc/apt/sources.list ADD tengine-2.2.1-bin.tar.gz /usr/local RUN apt-get update && apt-get install -y openssl libjemalloc-dev libpcre3 \ - && rm -rf /var/lib/apt/lists/* \ - && ln -sf /dev/stdout /usr/local/nginx/logs/access.log \ - && ln -sf /dev/stderr /usr/local/nginx/logs/error.log + && rm -rf /var/lib/apt/lists/* -COPY schbrain.com.key /usr/local/nginx/conf/schbrain.com.key -COPY schbrain.com.pem /usr/local/nginx/conf/schbrain.com.pem COPY nginx.conf /usr/local/nginx/conf/nginx.conf ENV NGINX_HOME /usr/local/nginx ENV PATH $PATH:$NGINX_HOME/sbin EXPOSE 80 -EXPOSE 443 CMD [ "nginx", "-g", "daemon off;" ] - diff --git a/tengine/nginx/nginx.conf b/tengine/nginx/nginx.conf index 910c77f..4aae777 100644 --- a/tengine/nginx/nginx.conf +++ b/tengine/nginx/nginx.conf @@ -24,9 +24,9 @@ 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"'; + log_format main '$remote_addr - $remote_user [$time_local] "$request" $http_host ' + '$status $request_length $body_bytes_sent "$http_referer" ' + '"$http_user_agent" $request_time $upstream_response_time'; #access_log logs/access.log main; @@ -36,49 +36,19 @@ http { #keepalive_timeout 0; keepalive_timeout 65; - client_max_body_size 5M; - client_body_buffer_size 128k; - #gzip on; server { - listen 80; - server_name www.schbrain.com; + listen 80 default; #charset koi8-r; #access_log logs/host.access.log main; location / { - root /var/html_root_80; - index index.html; - } - } - - # HTTPS server - - server { - listen 443 ssl; - server_name www.schbrain.com; - - ssl_certificate schbrain.com.pem; - ssl_certificate_key schbrain.com.key; - - ssl_session_cache shared:SSL:1m; - ssl_session_timeout 5m; - - ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_prefer_server_ciphers on; - - location / { - root /var/html_root; + root /var/app; index index.html; } - - location /api { - proxy_pass http://localhost:8080; - } } } -- GitLab