mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-01 12:24:31 +01:00
Add nginx configuration. Closes #1405
This commit is contained in:
49
conf/nginx/http.conf
Normal file
49
conf/nginx/http.conf
Normal file
@@ -0,0 +1,49 @@
|
||||
worker_processes 4;
|
||||
|
||||
events {
|
||||
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
# Configuration containing list of application servers
|
||||
upstream app_servers {
|
||||
|
||||
server ctfd:8000;
|
||||
}
|
||||
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
|
||||
client_max_body_size 4G;
|
||||
|
||||
# Handle Server Sent Events for Notifications
|
||||
location /events {
|
||||
|
||||
proxy_pass http://app_servers;
|
||||
proxy_set_header Connection '';
|
||||
proxy_http_version 1.1;
|
||||
chunked_transfer_encoding off;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_redirect off;
|
||||
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-Host $server_name;
|
||||
}
|
||||
|
||||
# Proxy connections to the application servers
|
||||
location / {
|
||||
|
||||
proxy_pass http://app_servers;
|
||||
proxy_redirect off;
|
||||
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-Host $server_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,15 @@ services:
|
||||
default:
|
||||
internal:
|
||||
|
||||
nginx:
|
||||
image: nginx:1.17
|
||||
volumes:
|
||||
- ./conf/nginx/http.conf:/etc/nginx/nginx.conf
|
||||
ports:
|
||||
- 80:80
|
||||
depends_on:
|
||||
- ctfd
|
||||
|
||||
db:
|
||||
image: mariadb:10.4.12
|
||||
restart: always
|
||||
|
||||
Reference in New Issue
Block a user