-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: "3.9" | ||
services: | ||
nginx: | ||
image: nginx | ||
container_name: nginx | ||
volumes: | ||
- ~/app/nginx/nginx.conf:/etc/nginx/nginx.conf | ||
- ~/app/nginx/conf.d:/etc/nginx/conf.d | ||
- ~/app/nginx/logs:/var/log/nginx | ||
- ~/app/nginx/ssl:/etc/ssl | ||
ports: | ||
- "9002:9001" | ||
depends_on: | ||
- id_allocation | ||
|
||
id_allocation: | ||
image: ghcr.io/zhongfuze/id_allocation:main | ||
container_name: id_allocation | ||
volumes: | ||
- ~/app/data:/app/data | ||
- ~/app/config:/app/config | ||
- ~/app/log_tmp:/tmp | ||
- ~/app/log:/app/log | ||
ports: | ||
- "9001:9001" | ||
networks: | ||
default: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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 '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
|
||
keepalive_timeout 65; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
|
||
server { | ||
listen 9001; | ||
server_name ec2-18-167-19-252.ap-east-1.compute.amazonaws.com; | ||
|
||
# Deny access to all resources by default | ||
location / { | ||
deny all; | ||
return 403; | ||
} | ||
|
||
# Allow access to the specific endpoint | ||
location /id_allocation/allocation { | ||
allow all; | ||
proxy_pass http://192.168.100.3:9001; | ||
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters