Skip to content

Commit

Permalink
Rebuild using new nginx template config
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouse committed Oct 29, 2020
1 parent 1c9e135 commit 0c74b43
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM nginx:alpine
MAINTAINER Jeremy T. Bouse <[email protected]>
LABEL maintainer="Jeremy T. Bouse <[email protected]>"

COPY nginx /etc/nginx/
COPY templates /etc/nginx/templates
COPY html /usr/share/nginx/html

VOLUME /etc/ssl
EXPOSE 80 443 11371

CMD ["nginx", "-g", "daemon off;"]
ENV SKS_HKP_PORT=11371 \
SKS_HOSTNAME=localhost \
SERVICES_DOMAIN=local
31 changes: 31 additions & 0 deletions templates/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
server {
listen 80 default_server;
access_log off;
server_tokens off;
root /usr/share/nginx/html;
index index.html index.htm;

rewrite ^/stats /pks/lookup?op=stats;
rewrite ^/s/(.*) /pks/lookup?search=$1;
rewrite ^/search/(.*) /pks/lookup?search=$1;
rewrite ^/g/(.*) /pks/lookup?op=get&search=$1;
rewrite ^/get/(.*) /pks/lookup?op=get&search=$1;
rewrite ^/d/(.*) /pks/lookup?op=get&options=mr&search=$1;
rewrite ^/download/(.*) /pks/lookup?op=get&options=mr&search=$1;

location /pks {
proxy_pass http://sks_backend;
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;
proxy_set_header X-Forwarded-Port $server_port;
proxy_pass_header Server;
proxy_ignore_client_abort on;
proxy_intercept_errors off;
client_max_body_size 8m;

add_header Via "1.1 ${SKS_HOSTNAME}:$server_port (nginx)";
add_header X-Robots-Tag 'noindex, nofollow' always;
}
}
7 changes: 7 additions & 0 deletions templates/nginx.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tcp_nopush on;
tcp_nodelay on;

types_hash_max_size 2048;

gzip on;
gzip_disable "msie6";
4 changes: 4 additions & 0 deletions templates/upstream.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
upstream sks_backend {
server node0.${SERVICES_DOMAIN}:${SKS_HKP_PORT};
server node1.${SERVICES_DOMAIN}:${SKS_HKP_PORT};
}

0 comments on commit 0c74b43

Please sign in to comment.