[damned-lies/oscp] Replace nginx.conf completely



commit db98feb1851f7bb41bc066450020ae6e956de731
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Thu Mar 26 14:53:02 2020 +0100

    Replace nginx.conf completely

 httpd_min/Dockerfile |  7 +----
 httpd_min/nginx.conf | 82 +++++++++++++++++++++++++++++++++++-----------------
 2 files changed, 57 insertions(+), 32 deletions(-)
---
diff --git a/httpd_min/Dockerfile b/httpd_min/Dockerfile
index dbb64441..ccb53a15 100644
--- a/httpd_min/Dockerfile
+++ b/httpd_min/Dockerfile
@@ -13,11 +13,6 @@ RUN groupadd l10n -g 1000660000 && \
 
 ADD entrypoint.sh /entrypoint.sh
 
-RUN sed -i -e '/listen/!b' -e '/80;/!b' -e 's/80;/8080;/' /etc/nginx/nginx.conf \
-    && sed -i -e '/user/!b' -e '/nginx/!b' -e '/nginx/d' /etc/nginx/nginx.conf \
-    && sed -i 's!/var/run/nginx.pid!/tmp/nginx.pid!g' /etc/nginx/nginx.conf \
-    && sed -i "/^http {/a \    proxy_temp_path /tmp/proxy_temp;\n    client_body_temp_path 
/tmp/client_temp;\n    fastcgi_temp_path /tmp/fastcgi_temp;\n    uwsgi_temp_path /tmp/uwsgi_temp;\n    
scgi_temp_path /tmp/scgi_temp;\n" /etc/nginx/nginx.conf
-
 # forward request and error logs to docker log collector
 RUN ln -sf /dev/stdout /var/log/nginx/access.log \
     && ln -sf /dev/stderr /var/log/nginx/error.log
@@ -28,7 +23,7 @@ RUN chown -R l10n:0 /var/lib/nginx /var/log/nginx \
 
 STOPSIGNAL SIGTERM
 
-ADD nginx.conf /etc/nginx/conf.d/connfa.conf
+ADD nginx.conf /etc/nginx/nginx.conf
 
 USER l10n 
 ENTRYPOINT ["/entrypoint.sh"]
diff --git a/httpd_min/nginx.conf b/httpd_min/nginx.conf
index 9893bd92..5257ab95 100644
--- a/httpd_min/nginx.conf
+++ b/httpd_min/nginx.conf
@@ -1,37 +1,67 @@
-upstream uwsgi {
-    server uwsgi.damned-lies.svc.cluster.local:8000;
+worker_processes auto;
+error_log /var/log/nginx/error.log;
+pid /run/nginx.pid;
+
+# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
+include /usr/share/nginx/modules/*.conf;
+
+events {
+    worker_connections 1024;
 }
 
-server {
-    listen 8080 default_server;
-    listen [::]:8080 default_server;
-    root /var/www/connfa;
-    try_files $uri$args $uri$args/ $uri $uri/ /index.html =404;
-    add_header 'Access-Control-Allow-Origin' '*';
-    add_header 'Access-Control-Allow-Methods' 'GET';
+http {
+    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;
 
-    location /HTML {
-        alias /var/www/djamnedlies/data/scratchdir/HTML;
-    }
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                      '$status $body_bytes_sent "$http_referer" '
+                      '"$http_user_agent" "$http_x_forwarded_for"';
 
-    location /POT {
-        alias /var/www/djamnedlies/data/scratchdir/POT;
-    }
+    access_log  /var/log/nginx/access.log  main;
 
-    location /static {
-        alias /l10n/damnedlies/static;
-    }
+    sendfile            on;
+    tcp_nopush          on;
+    tcp_nodelay         on;
+    keepalive_timeout   65;
+    types_hash_max_size 2048;
 
-    location /media {
-        alias /var/www/djamnedlies/data/media;
-    }
+    include             /etc/nginx/mime.types;
+    default_type        application/octet-stream;
 
-    location /robots.txt {
-        alias /l10n/damnedlies/static/robots.txt;
+    upstream uwsgi {
+       server uwsgi.damned-lies.svc.cluster.local:8000;
     }
 
-    location / {
-       include uwsgi_params;
-        uwsgi_pass uwsgi;
+    server {
+       listen 8080 default_server;
+       listen [::]:8080 default_server;
+
+       location /HTML {
+           alias /var/www/djamnedlies/data/scratchdir/HTML;
+       }
+
+       location /POT {
+           alias /var/www/djamnedlies/data/scratchdir/POT;
+       }
+
+       location /static {
+           alias /l10n/damnedlies/static;
+       }
+
+       location /media {
+           alias /var/www/djamnedlies/data/media;
+       }
+
+       location /robots.txt {
+           alias /l10n/damnedlies/static/robots.txt;
+       }
+
+       location / {
+           include uwsgi_params;
+           uwsgi_pass uwsgi;
+       }
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]