diff --git a/nginx/data/conf.d/.gitkeep b/nginx/data/conf.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/nginx/data/html/.gitkeep b/nginx/data/html/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/nginx/data/html/50x.html b/nginx/data/html/50x.html new file mode 100644 index 0000000..a57c2f9 --- /dev/null +++ b/nginx/data/html/50x.html @@ -0,0 +1,19 @@ + + +
+Sorry, the page you are looking for is currently unavailable.
+Please try again later.
If you are the system administrator of this resource then you should check +the error log for details.
+Faithfully yours, nginx.
+ + diff --git a/nginx/data/html/index.html b/nginx/data/html/index.html new file mode 100644 index 0000000..e8f5622 --- /dev/null +++ b/nginx/data/html/index.html @@ -0,0 +1,23 @@ + + + +If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.
+ +For online documentation and support please refer to
+nginx.org.
+Commercial support is available at
+nginx.com.
Thank you for using nginx.
+ + diff --git a/nginx/data/logs/.gitkeep b/nginx/data/logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/nginx/data/nginx.conf b/nginx/data/nginx.conf new file mode 100644 index 0000000..055605e --- /dev/null +++ b/nginx/data/nginx.conf @@ -0,0 +1,63 @@ + +#user nobody; +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; + + upstream backend_servers{ + server localhost:8000; + server localhost:8001; + } + + server { + listen 80; + server_name example.com; + absolute_redirect off; + + #charset koi8-r; + + #access_log logs/host.access.log main; + + location / { + proxy_pass http://backend_servers/; + } + + #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; + } + } +} + diff --git a/nginx/docker-compose.yml b/nginx/docker-compose.yml new file mode 100644 index 0000000..9aa9bcd --- /dev/null +++ b/nginx/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' +services: + nginx: + image: nginx:latest + container_name: nginx + restart: unless-stopped + network_mode: host + volumes: + - ./data/conf.d:/etc/nginx/conf.d + - ./data/nginx.conf:/etc/nginx/nginx.conf + - ./data/logs:/var/log/nginx + - ./data/html:/var/www/html