From 76af4f3bb4062ee9e235c6269d8c756401ad9bdd Mon Sep 17 00:00:00 2001 From: saroar Date: Sun, 24 Mar 2024 11:04:11 +0000 Subject: [PATCH] update nginx and docker compose --- README.md | 20 ++++++++++++++++++++ docker-compose.yml | 21 ++++++++++++++++----- nginx/default.conf | 13 +++++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 nginx/default.conf diff --git a/README.md b/README.md index f89fdcb..754bf53 100644 --- a/README.md +++ b/README.md @@ -1 +1,21 @@ # AddameServer + + + +4. Check for Configuration File Inside the Container +You can also directly check the contents of the /etc/nginx/conf.d directory +inside the container to ensure your configuration file is present: + + +docker exec addame_nginx_rp ls /etc/nginx/conf.d + +And to inspect the contents of your configuration file (replace default.conf with your file name if different): + +docker exec addame_nginx_rp cat /etc/nginx/conf.d/default.conf + +If the configuration file is correctly placed and Nginx still doesn't seem to behave as expected, +review the configuration file for syntax errors or misconfigurations. +You can use nginx -t inside the container to test the Nginx configuration for syntax correctness: + + +docker exec addame_nginx_rp nginx -t diff --git a/docker-compose.yml b/docker-compose.yml index ae2b8b4..cfe84d3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,16 +37,14 @@ services: addame_server: image: addamespb/addame_server:latest - container_name: addameServer + container_name: addame_server build: context: addameServer environment: <<: *shared_environment ports: - - '80:8080' - - '443:8080' - - '8080:8080' - command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8080"] + - '8010:8010' + command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8010"] volumes: - ~/addameServer:/addameServer_data - ./.env:/app/.env @@ -59,6 +57,19 @@ services: env_file: - ./.env + addame_nginx: + image: nginx:latest + container_name: addame_nginx_rp + ports: + - '80:80' + - '443:443' + volumes: + - ./nginx:/etc/nginx/conf.d:ro + depends_on: + - addame_server + networks: + - addame_pro_gateway + volumes: addameServer: redis-persistence-production: diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..9996b17 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,13 @@ + +server { + listen 80; + server_name addame.com; + + location / { + proxy_pass http://addame_server:8010; # Adjusted to match your service name and internal port + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +}