Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andrew/split confs #37

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,4 @@ COPY auth /usr/share/nginx/recovery
COPY export /usr/share/nginx/export
COPY import /usr/share/nginx/import

# prod
EXPOSE 8080/tcp
EXPOSE 8081/tcp
EXPOSE 8082/tcp
EXPOSE 8083/tcp

# preprod
EXPOSE 7070/tcp
EXPOSE 7071/tcp
EXPOSE 7072/tcp
EXPOSE 7073/tcp

CMD ["nginx"]
# leave port exposure and commands up to gitops
72 changes: 72 additions & 0 deletions nginx.preprod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Taken from the default nginx config in our base image
# See "Customize configuration" on https://hub.docker.com/_/nginx
pid /tmp/nginx.pid;
worker_processes auto;
events {
worker_connections 1024;
}

# Send anything from info to errors to stdout for logging
error_log /dev/stdout info;

# Run in the foreground
daemon off;

http {
# Taken from the default nginx config in our base image
# See "Customize configuration" on https://hub.docker.com/_/nginx
proxy_temp_path /tmp/proxy_temp;
client_body_temp_path /tmp/client_temp;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;

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"';

sendfile on;
keepalive_timeout 65;
gzip on;

# Send access logs to stdout for logging
access_log /dev/stdout main;

# Custom server blocks to serve auth and export frames on separate ports.
# Maintain recovery and auth separately for now for backwards-compatibility.

# Preprod
server {
listen 7070;
root /usr/share/nginx/auth;
index index.preprod.html;

# Health endpoint for k8s
location = /health {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 '{"status":"UP"}';
}
}

server {
listen 7071;
root /usr/share/nginx/export;
index index.preprod.html;
}

server {
listen 7072;
root /usr/share/nginx/recovery;
index index.preprod.html;
}

server {
listen 7073;
root /usr/share/nginx/import;
index index.preprod.html;
}
}
68 changes: 68 additions & 0 deletions nginx.prod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Taken from the default nginx config in our base image
# See "Customize configuration" on https://hub.docker.com/_/nginx
pid /tmp/nginx.pid;
worker_processes auto;
events {
worker_connections 1024;
}

# Send anything from info to errors to stdout for logging
error_log /dev/stdout info;

# Run in the foreground
daemon off;

http {
# Taken from the default nginx config in our base image
# See "Customize configuration" on https://hub.docker.com/_/nginx
proxy_temp_path /tmp/proxy_temp;
client_body_temp_path /tmp/client_temp;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;

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"';

sendfile on;
keepalive_timeout 65;
gzip on;

# Send access logs to stdout for logging
access_log /dev/stdout main;

# Custom server blocks to serve auth and export frames on separate ports.
# Maintain recovery and auth separately for now for backwards-compatibility.

# Prod
server {
listen 8080;
root /usr/share/nginx/auth;

# Health endpoint for k8s
location = /health {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 '{"status":"UP"}';
}
}

server {
listen 8081;
root /usr/share/nginx/export;
}

server {
listen 8082;
root /usr/share/nginx/recovery;
}

server {
listen 8083;
root /usr/share/nginx/import;
}
}
Loading