diff --git a/.docker/nginx-default.conf b/.docker/nginx-default.conf index b007486..8083f26 100644 --- a/.docker/nginx-default.conf +++ b/.docker/nginx-default.conf @@ -1,24 +1,22 @@ -server { - listen 80; - server_name helldivehelper.net www.helldivehelper.net; + server { + listen 80; + server_name helldivehelper.net www.helldivehelper.net; - # access_log /var/log/nginx/host.access.log main; + root /var/www/html; + index index.html index.htm; - root /var/www/html; - index index.html index.htm; + location / { + try_files $uri /index.html; + } - location / { - try_files $uri /index.html; + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } } - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } -} + + -# http { -# log_format main escape=json '{"source": "nginx", "time": $msec, "resp_body_size": $body_bytes_sent, "host": "$http_host", "address": "$remote_addr", "request_length": $request_length, "method": "$request_method", "uri": "$request_uri", "status": $status, "user_agent": "$http_user_agent", "resp_time": $request_time, "upstream_addr": "$upstream_addr"}'; -# } \ No newline at end of file diff --git a/.docker/nginx.conf b/.docker/nginx.conf new file mode 100644 index 0000000..f548667 --- /dev/null +++ b/.docker/nginx.conf @@ -0,0 +1,29 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main escape=json '{"source": "nginx", "time": $msec, "resp_body_size": $body_bytes_sent, "host": "$http_host", "address": "$remote_addr", "request_length": $request_length, "method": "$request_method", "uri": "$request_uri", "status": $status, "user_agent": "$http_user_agent", "resp_time": $request_time, "upstream_addr": "$upstream_addr"}'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 328895d..65a25e9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: - NODE_ENV volumes: - "helldive-helper-data:/opt/${APP_NAME}" + - .docker/nginx.conf:/etc/nginx/nginx.conf - .docker/nginx-default.conf:/etc/nginx/conf.d/default.conf cpus: 1.5 dns: